Riken ScraperDocs

Errors

Every error code, what it means and what to do. Errors are never charged.

Every error body on the TikTok routes has the same shape. Branch on error: it is stable. message is for people and may change.

{
  "success": false,
  "error": "<code>",
  "errorStatus": 400,
  "message": "<for people>",
  "credits_charged": 0
}

All codes

The TikTok routes (/v1/tiktok/..., /v3/tiktok/...):

StatuserrorRoutesMeaningWhat to doCharged
400bad_requestallA parameter is missing or malformed: no handle, a character TikTok does not allow, a query over 200 bytes, an Idempotency-Key over 255 characters.Fix the request.Free
400unsupported_parameterallA parameter value we cannot honour yet, a user_id not in our index, or a user_id whose handle has changed.Drop the parameter, or pass handle.Free
400invalid_cursorsearchThe cursor is not from a previous answer to the same query with the same API key.Start again without a cursor.Free
400cursor_expiredsearchThe cursor is older than 24 hours, or the search session expired.Start again from page 1.Free
401unauthorizedallMissing, unknown or revoked key.Send x-api-key.Free
402insufficient_creditsallThe key cannot cover this request. The body has needed_credits and credits_remaining.Top up.Free
404not_foundprofile videos, followers, following, audienceThe account does not exist (account_deactivated: true).Check the handle.Free
409idempotency_conflictallA request with this Idempotency-Key and parameters is still running. Retry-After: 1.Retry after it finishes.Free
409cursor_region_changedsearchPage 2+ could only be searched from another country than page 1.Start again from page 1.Free
409cursor_exit_gonesearchThe search session behind this cursor is gone.Start again from page 1.Free
429over_capacityallNo capacity to answer within the time limit, or the server is restarting. Has Retry-After.Wait Retry-After seconds and retry.Free
429rate_limitedprofile, profile videos, followers, followingThe free-answer limit: this answer would have been free, and the key has had 100 free answers in 10 minutes. Has Retry-After.Wait, or fix the handles you send.Free
500internalallOur fault.Retry. Report the X-Request-Id.Free
501not_yet_availableprofile videosmax_cursor asks for page 2+, which is not available in beta.Call without max_cursor.Free
502upstream_failedallTikTok's answer failed or could not be read, including accounts TikTok withholds.Retry later.Free
503route_not_pricedallThe route has no price yet, so it does not serve.The route is not open yet.Free
503search_unavailablesearchNo search capacity right now. Retry-After: 60.Retry after 60 seconds.Free
504timeoutallNo answer within the time limit: 180 seconds, 300 for audience.Retry.Free

Job routes

/v1/jobs, /v1/search and export answer errors in their own shape, with the code under error.code:

{
  "error": {
    "code": "invalid_unit",
    "message": "<for people>",
    "field": "keywords"
  }
}
Statuserror.codeRoutesMeaningWhat to doCharged
400bad_requestjobsThe body or a parameter is malformed, or has an unknown field.Fix the request.Free
400invalid_unitsubmit a job, searchA keyword or handle cannot be used as given. error.field says which list.Fix that unit.Free
400cursor_expiredget a jobA paging cursor from before the id-order change.Start again without a cursor.Free
401unauthorizedjobsMissing, unknown or revoked key.Send x-api-key.Free
402insufficient_creditssubmit a job, searchThe key cannot hold the job's credits. error has needed_credits and available_credits.Top up, or submit fewer units.Free
404not_foundjobsNo such job, another key's job, or no export requested yet.Check the job id and key.Free
409idempotency_conflictsubmit a job, searchThis Idempotency-Key was used with a different request. error.job_id is that job.Use a new Idempotency-Key.Free
409job_not_finishedexportThe job is still queued or running, or its results are still being saved.Poll the job until finished_at is set.Free
429rate_limitedjobsThe key's request rate on the job routes. Has Retry-After.Wait Retry-After seconds.Free
429concurrency_limitsubmit a job, searchThe key already has its maximum of jobs queued or running. Retry-After: 10.Wait for a job to finish, or cancel one.Free
500internaljobsOur fault.Retry.Free
503export_unavailableexportExport is switched off on this server.Page the job instead, or retry later.Free

Not found on profile videos and followers

The 404 of profile videos and followers carries a few extra keys:

{
  "success": false,
  "error": "not_found",
  "errorStatus": 404,
  "message": "Account deactivated",
  "account_deactivated": true,
  "handle": "no_such_user_123",
  "credits_charged": 0,
  "credits_remaining": 998
}

A profile of an account that does not exist is different: it is a 200 with account_deactivated: true, and it is charged. See Credits and pricing.

Retrying

statusretry?
400, 401, 402, 404no: fix the request, the key or the balance first
409yes, after Retry-After, or start the search again from page 1
429yes, after Retry-After seconds
500, 502, 504yes, with backoff. Report the X-Request-Id if it keeps happening.
501, 503 route_not_pricedno: the feature is not open yet
503 search_unavailableyes, after 60 seconds

Send an Idempotency-Key on every retry.

On this page