Key Information/Error Codes

Error Codes

Cito API uses conventional HTTP response codes to indicate success or failure of requests.

HTTP Status Codes

CodeErrorDescription
400Bad RequestMalformed request (rare: the API validates instead)
401UnauthorizedInvalid or missing API key
403ForbiddenAPI key doesn't have access to this resource
404Not FoundResource doesn't exist (or unsupported method: read-only GET API returns 405 with an Allow header)
422Unprocessable EntityInvalid parameters — wrong enum value, out-of-range page, or a bad date. The error lists the valid values (e.g. surface must be one of: Clay, Grass, Hard, Carpet)
429Rate LimitPer-minute rate limit, monthly quota, concurrency cap, or monthly >90d deep-history credit sub-cap (HISTORICAL_ARCHIVE_CAP_EXCEEDED)
500Server ErrorSomething went wrong on our end
503Service UnavailableAPI is temporarily down (check status page)

Error Response Format

All errors follow the same structure:

JSON
{
  "error": {
    "type": "invalid_request",
    "message": "Player 'Bugha123' not found",
    "param": "username",
    "code": "player_not_found"
  }
}
FieldDescription
typeThe type of error (see table below)
messageA human-readable error message
paramThe parameter that caused the error (if applicable)
codeA machine-readable error code

Error Types

TypeDescription
invalid_requestThe request was invalid or malformed
authentication_errorInvalid or expired API key
authorization_errorAPI key lacks permission for this action
not_foundThe requested resource was not found
rate_limit_exceededToo many requests in the time window
validation_errorOne or more request parameters are invalid
internal_errorAn unexpected error occurred on our servers

Handling Errors

Code
try {
  const response = await fetch('https://api.citoapi.com/api/v1/fortnite/players/bugha', {
    headers: { 'x-api-key': process.env.CITO_API_KEY }
  });

  if (!response.ok) {
    const { error } = await response.json();

    switch (error.type) {
      case 'not_found':
        console.log(`Player not found: ${error.message}`);
        break;
      case 'rate_limit_exceeded':
        // Wait and retry
        await sleep(error.retry_after * 1000);
        break;
      case 'authentication_error':
        console.log('Invalid API key');
        break;
      default:
        console.log(`Error: ${error.message}`);
    }
    return;
  }

  const data = await response.json();
  console.log(data);
} catch (err) {
  console.error('Network error:', err);
}

Common Issues

"Invalid API key provided"

Check that you're using the correct key prefix (cito_) and that the key hasn't been revoked.

"Player not found"

Usernames are case-sensitive. Make sure you're using the exact username as it appears in-game.

"Rate limit exceeded"

Wait for the retry_after period and consider implementing caching or upgrading your plan.

429 HISTORICAL_ARCHIVE_CAP_EXCEEDED

Returned only on monthly plans when your monthly deep-history (>90d) credit sub-cap is exhausted (2,500/mo Legacy monthly, 2,500/mo Pro Monthly, 5,000/mo Scale Monthly, 500/mo if cancellation is pending). Annual plans (Pro Annual $472/yr, Scale Annual $800/yr) have no >90d sub-cap and no >=91d credit multipliers (flat 1 credit/call across all historical dates). 0-90d, live, upcoming, and bio endpoints continue returning 200 OK. Switch to Annual billing or upgrade to Business CSV ($299/mo) for unlimited >90d sub-cap plus Master Baseline + Daily Delta CSVs (0 REST credits).

Was this page helpful?