Suggestions
Get what Yahoo! JAPAN's search box suggests for a query.
GET | POST /v1/yahoo-japan/suggestionsSend parameters as a query string with GET, or as a JSON body with POST. Both are equivalent.
Request
curl -G "https://gateway.apinoa.com/v1/yahoo-japan/suggestions" \
--data-urlencode "q=東京" \
-H "x-api-key: $APINOA_API_KEY"Parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
q | string | yes | The query, search operators included. |
country | enum | The market, as an ISO 3166 country code. JP |
The same parameters, and every response type, are in the OpenAPI document.
Response
Returns Suggestions in data. A real response, shortened: arrays keep their first entries and long text is cut.
{
"success": true,
"data": {
"engine": "yahoo-japan",
"query": "東京",
"country": "JP",
"suggestions": [
{
"text": "東京電力",
"type": "query",
"ext": {
"url": "https://search.yahoo.co.jp/search?ei=UTF-8&p=%E6%9D%B1%E4%BA%AC%E9%9B%BB%E5%8A%9B&ai=2bec0c7d-70e8-4738-81cd-17060a283ad3&at=s"
}
},
{
"text": "東京ガス",
"type": "query",
"ext": {
"url": "https://search.yahoo.co.jp/search?ei=UTF-8&p=%E6%9D%B1%E4%BA%AC%E3%82%AC%E3%82%B9&ai=2bec0c7d-70e8-4738-81cd-17060a283ad3&at=s"
}
}
]
}
}Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | INVALID_PARAMS | A parameter is missing, unknown or out of range, or the engine does not take it. The message names it. |
| 401 | UNAUTHORIZED | The x-api-key header is missing, or the key is revoked or unknown. |
| 402 | INSUFFICIENT_BALANCE | The balance does not cover this call. Top up in the dashboard. |
| 429 | MARKETPLACE_SATURATED | Too many concurrent calls. Retry after the Retry-After seconds. |
| 502 | UPSTREAM_ERROR | The engine answered with something unusable. Retry with backoff. |
| 503 | SERVICE_UNAVAILABLE | A temporary failure. Retry with backoff. |
Every code is listed in Errors. Failed calls are not billed.
Pricing
Price $0.0012 per call. List price; the rate steps down above 1,000 calls a day.