LLegiScoreSearch API
Get an API key
Get started
IntroductionAuthenticationQuickstartSearch lifecycleErrorsWebhooksCreditsGet an API key
API reference
Credit balancegetCataloggetLookupsgetSearchespost
States
All states
View as Markdownllms-full.txt

Get started

Errors

Every failure carries error.code and error.message. 422 and 429 also follow RFC 9457 problem details.

json
{
  "error": {
    "code": "insufficient_credits",
    "message": "Your search wallet does not hold enough credits for this request."
  }
}

HTTP status and codes

HTTPerror.codeWhen
400invalid_body too_many invalid_idempotency_key invalid_otpMalformed request, more than 25 searches in a batch, or a bad idempotency key or OTP.
401unauthorizedMissing, unknown or deactivated key. See Authentication.
402insufficient_creditsThe whole request is refused and nothing is charged.
404not_found unknown_dim unsupported_stateNo such search, lookup or state.
409already_finished not_waiting not_finished already_recovery idempotency_key_reusedThe search is not in a state that allows this call.
410withheldA document failed its integrity check and is not served.
422invalid_params search_unavailableThe parameters cannot be answered, or the search is held. Nothing is charged.
429rate_limited too_many_open_searches upstream_busySlow down. Honour Retry-After.
502 / 503assist_failed recovery_failed recovery_unavailable place_search_unavailableAn optional layer or a lookup could not answer. Retry later.
500internalUnexpected. Safe to retry, then contact us.

422 invalid_params

We check your parameters before anything is charged or sent to a source. Every problem is listed, with the field, what you sent and why it was refused. When the field is a place or office, lookup names thelookup that resolves it.

json
{
  "type": "https://legiscore.in/docs/errors#invalid-params",
  "title": "Unprocessable search parameters",
  "status": 422,
  "detail": "sro_code 9999 is not a registered office for telangana.",
  "invalid_params": [
    {
      "index": 0,
      "field": "sro",
      "value": "9999",
      "reason": "sro_code 9999 is not a registered office for telangana.",
      "lookup": "sro"
    }
  ],
  "error": { "code": "invalid_params", "message": "sro_code 9999 is not a registered office for telangana." }
}

422 search_unavailable

The search is held at the moment (shown as HELD on its page). It is refused at submit, before any charge. Check the catalog for current status.

429 too many requests

Three independent limits, all answered the same way, so you need one retry path. The response has Retry-After (seconds) and X-RateLimit-Limit / X-RateLimit-Remaining.

LimitDefaultApplies to
Submit120 searches per minute per key. A batch of 25 spends 25.POST /api/v1/search
Reads10 times the submit budget per keyGET search and list
Open searches100 queued or running per workspacePOST /api/v1/search
Lookups120 calls per minute per keyGET lookups and places
json
{
  "type": "https://legiscore.in/docs/errors#too-many-requests",
  "title": "Too Many Requests",
  "status": 429,
  "detail": "Rate limit reached: 120 per minute for this key. Retry after 12s.",
  "retry_after": 12,
  "error": { "code": "rate_limited", "message": "Rate limit reached: 120 per minute for this key. Retry after 12s." }
}

upstream_busy means the search service is at capacity. Nothing was charged. Retry after the interval given. In a batch, an item refused this way appears in rejected[] with its own retry_after.

PreviousSearch lifecycleNextWebhooks