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.
Web search
POST
https://iranrouter.com/v1/search| Name | Type | Notes |
|---|---|---|
query | string | Required. What to search for, at most 500 characters. |
n | int | How many results, 1 to 10. Default 5. |
{
"object": "search.results",
"query": "...",
"results": [{ "title": "...", "url": "https://...", "snippet": "..." }],
"usage": { "cost_rial": 1250 }
}Page read
POST
https://iranrouter.com/v1/fetch| Name | Type | Notes |
|---|---|---|
url | string | Required. The full address of a public http or https page. |
{ "object": "page", "url": "https://...", "text": "...", "usage": { "cost_rial": 1250 } }A page that could not be read costs nothing and answers page_unavailable.
Errors
insufficient_balanceThe wallet does not cover the call.service_limit_reachedThe plan's allowance for this service is used up.service_not_availableThis service is not open at the moment.