# Bing Suggestions API

<p><strong>Bing Suggestions API documentation</strong> for developers who need Bing query search suggestions as JSON. Scrappa's <code>GET /api/bing/suggestions</code> endpoint returns the completions Bing offers while a user types.</p><h2>How to call the endpoint</h2><p>Send a <code>GET</code> request to <code>/api/bing/suggestions</code> with a required <code>query</code> parameter and your Scrappa API key in the <code>x-api-key</code> header. The <code>q</code> alias is also accepted. Add <code>mkt</code>, <code>cc</code> and <code>setlang</code> to get the search suggestions of another market, for example German suggestions with <code>mkt=de-DE</code>.</p><h2>Response fields</h2><p>Each entry in <code>suggestions</code> (also returned as <code>data</code>) has <code>text</code>, <code>type</code> and <code>sk</code> when Bing sends them. The response also echoes <code>query</code> and <code>market</code>.</p>

- **Documentation:** [https://scrappa.co/docs/bing-search-api/bing_suggestions](https://scrappa.co/docs/bing-search-api/bing_suggestions)
- **API group:** Bing Search API
- **Endpoint:** `GET https://scrappa.co/api/bing/suggestions`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | Yes | <p>The text to complete.</p><p><strong>Example:</strong> <code>pizza</code></p> |
| `q` | string | No | <p>Alias for <code>query</code>. Prefer <code>query</code> for new integrations.</p> |
| `mkt` | string | No | <p>Bing market, language and region together, for example <code>de-DE</code> or <code>en-GB</code>. Results, wording and dates follow the market.</p><p><strong>Default:</strong> <code>en-US</code></p> |
| `cc` | string | No | <p>Two-letter country code, for example <code>DE</code>. Scrappa sends it together with <code>mkt</code>.</p><p><strong>Default:</strong> the country of <code>mkt</code></p> |
| `setlang` | string | No | <p>Interface language, for example <code>de</code>. Scrappa sends it together with <code>mkt</code>.</p><p><strong>Default:</strong> the language of <code>mkt</code></p> |

## Example response

```json
{
    "data": [
        {
            "sk": null,
            "text": "pizza hut",
            "type": "FT"
        },
        {
            "sk": "FT1",
            "text": "pizza near me",
            "type": "AS"
        },
        {
            "sk": "FT1AS5",
            "text": "pizza oven",
            "type": "AS"
        }
    ],
    "query": "pizza",
    "market": {
        "cc": "US",
        "mkt": "en-US",
        "setlang": "en"
    },
    "source": "bing",
    "suggestions": [
        {
            "sk": null,
            "text": "pizza hut",
            "type": "FT"
        },
        {
            "sk": "FT1",
            "text": "pizza near me",
            "type": "AS"
        },
        {
            "sk": "FT1AS5",
            "text": "pizza oven",
            "type": "AS"
        }
    ],
    "results_on_page": 3
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | The query is missing or too long, or mkt, cc or setlang is malformed. |
| 503 | Bing Temporarily Unavailable | Bing did not return usable data after the bounded retry on a second route. The request is not billed. Retry shortly. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
