Get the API's index
/v1 Answers what the API is and where its documentation and OpenAPI document are. Needs no token.
Use it to check you have the right address: https://api.rabbitflare.com/v1.
Example request
curl "https://api.rabbitflare.com/v1" const res = await fetch("https://api.rabbitflare.com/v1");
if (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);
const { data } = await res.json();
console.log(data); import { Rabbitflare } from "@rabbitflare/api";
const rf = new Rabbitflare();
const data = await rf.meta.index();
console.log(data); <?php
$ch = curl_init('https://api.rabbitflare.com/v1');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($body === false || $status >= 400) {
throw new RuntimeException("Rabbitflare API error $status: $body");
}
print_r(json_decode($body, true)['data']); import requests
response = requests.get(
"https://api.rabbitflare.com/v1",
timeout=120,
)
response.raise_for_status()
print(response.json()["data"]) Response
200 OK Returns the ApiIndex object in data.
The ApiIndex object's fields 4 fields
| Field | Type and description |
|---|---|
name | string Always “Rabbitflare API”. |
version | string The API's major version, the one in the path: v1. |
documentationUrl | string Where the API's documentation is. |
openapiUrl | string The API's OpenAPI 3.1 document (GET /v1/openapi.json). |
Example response
{
"data": {
"name": "Rabbitflare API",
"version": "v1",
"documentationUrl": "https://rabbitflare.com/docs/api",
"openapiUrl": "https://api.rabbitflare.com/v1/openapi.json"
}
} Errors
The errors this request can answer besides those every request can (a missing token, a missing scope, the rate limits). Each answer is an Error object (see Errors).
| Status and code | When, and what to do |
|---|---|
400 invalid_ | A query parameter is unknown or has a wrong value ( Correct or remove the parameter named in |
429 rate_ | Too many requests. Wait for Retry-After seconds, then go on more slowly. |
503 api_ | The API is switched off for everyone for a while. Try again later; Retry-After says when. |