Search and page read

Two standalone services with their own price: web search and reading one page.

Two services apart from the models, on the same API key. Each call has its own fixed price, taken from the wallet, unless your plan includes the service in its allowance. When a plan's allowance is used up the call is refused and nothing is taken from the wallet.

POSThttps://iranrouter.com/v1/search
NameTypeNotes
querystringRequired. What to search for, at most 500 characters.
nintHow many results, 1 to 10. Default 5.
Text
{
  "object": "search.results",
  "query": "...",
  "results": [{ "title": "...", "url": "https://...", "snippet": "..." }],
  "usage": { "cost_rial": 1250 }
}

Page read

POSThttps://iranrouter.com/v1/fetch
NameTypeNotes
urlstringRequired. The full address of a public http or https page.
Text
{ "object": "page", "url": "https://...", "text": "...", "usage": { "cost_rial": 1250 } }

A page that could not be read costs nothing and answers page_unavailable.

Errors

  • insufficient_balance The wallet does not cover the call.
  • service_limit_reached The plan's allowance for this service is used up.
  • service_not_available This service is not open at the moment.