API
API root
GET/v1
No API keyRate-limited
Names the API and its version. A good first request.
Try it#
Sends a real request to the production API through this site. No credentials are used, so you see exactly what anyone would.
Response
Request#
curl "https://api.rankdmusic.app/v1"const response = await fetch('https://api.rankdmusic.app/v1');
const body = await response.json();
if (!response.ok) {
const code = typeof body.error === 'string' ? body.error : body.error.code;
throw new Error(`Rankd API ${response.status}: ${code}`);
}
const { data, meta } = body;import Foundation
let url = URL(string: "https://api.rankdmusic.app/v1")!
let (data, response) = try await URLSession.shared.data(from: url)
guard let http = response as? HTTPURLResponse, http.statusCode == 200 else {
throw URLError(.badServerResponse)
}
let body = try JSONSerialization.jsonObject(with: data) as? [String: Any]
let result = body?["data"]import requests
response = requests.get("https://api.rankdmusic.app/v1", timeout=10)
body = response.json()
if not response.ok:
error = body["error"]
raise RuntimeError(error if isinstance(error, str) else error["code"])
data = body["data"]Response#
A successful response is { "data": …, "meta": … }. data is a ApiInfo, and meta is a Meta.
| Field | Type | Description |
|---|---|---|
| namealways | string | The API’s name. |
| versionalways | integer | The API version. |
| documentation | string | A pointer to Rankd’s internal notes. Use this site instead. |
Responses#
200The API and its version.
Captured from production: GET /v1
200 response
{
"data": {
"name": "Rankd API",
"version": 1,
"documentation": "docs/api/v1.md"
},
"meta": {
"apiVersion": 1,
"migrationPhase": 3,
"sourceOfTruth": "per_account"
}
}429Too many requests this minute. Wait Retry-After seconds, then try again.
Headers: Retry-After Seconds to wait. Always 60.
429 response
{
"error": "rate limited"
}