# Bing Images API

<p><strong>Bing Images API documentation</strong> for developers who need Bing image search as JSON. Scrappa's <code>GET /api/bing/images</code> endpoint returns full-size image URLs, thumbnails, the source page, dimensions and format.</p><h2>How to call the endpoint</h2><p>Send a <code>GET</code> request with a required <code>query</code> and your API key in the <code>x-api-key</code> header. Page with <code>page</code> (1-20, 35 images per page; pages can repeat an image, so de-duplicate by <code>image_url</code> when you merge pages). Filter with <code>size</code> (small, medium, large, wallpaper), <code>layout</code> (square, wide, tall), <code>type</code> (photo, clipart, linedrawing, animatedgif, transparent), <code>color</code>, <code>freshness</code> (day, week, month, year) and <code>license</code> (any, public_domain). Filters can be combined. Unknown values return a validation error.</p><h2>Response fields</h2><p>Each image has <code>position</code>, <code>id</code>, <code>title</code>, <code>description</code>, <code>image_url</code>, <code>thumbnail</code>, <code>source_page</code>, <code>source_domain</code>, <code>width</code>, <code>height</code> and <code>format</code>. With <code>size</code> or <code>layout</code>, images whose own width and height do not fit the filter are removed, so a page can hold fewer than 35 images.</p>

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

## 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>Image search query.</p><p><strong>Example:</strong> <code>red car</code></p> |
| `q` | string | No | <p>Alias for <code>query</code>. Prefer <code>query</code> for new integrations.</p> |
| `page` | string | No | <p>Page number, 35 images per page.</p><p><strong>Range:</strong> 1-20</p><p><strong>Default:</strong> 1</p> |
| `size` | string | No | <p><code>small</code> (under 300 px), <code>medium</code> (300-499 px), <code>large</code> (500 px or more) or <code>wallpaper</code> (1200 px wide or more).</p> |
| `layout` | string | No | <p><code>square</code>, <code>wide</code> or <code>tall</code>.</p> |
| `type` | string | No | <p><code>photo</code>, <code>clipart</code>, <code>linedrawing</code>, <code>animatedgif</code> or <code>transparent</code>.</p> |
| `color` | string | No | <p>color, bw, red, orange, yellow, green, teal, blue, purple, pink, brown, black, gray or white.</p> |
| `freshness` | string | No | <p>Image age: <code>day</code>, <code>week</code>, <code>month</code> or <code>year</code>.</p> |
| `license` | string | No | <p><code>any</code> or <code>public_domain</code>.</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": [
        {
            "id": "80C32659D50C3DB9A1F99014E0061671F40BD60F",
            "title": "Red Car Clipart Photos, Download The BEST Free Red Car Clipart Stock ...",
            "width": 5456,
            "format": "jpg",
            "height": 3632,
            "position": 1,
            "image_url": "https://images.pexels.com/photos/3729464/pexels-photo-3729464.jpeg",
            "thumbnail": "https://ts4.mm.bing.net/th?id=OIP.B89JFviebUWHqx55l28wEQHaE7&pid=15.1",
            "description": "Red Car Clipart Photos, Download The BEST Free Red Car Clipart Stock ...",
            "source_page": "https://www.pexels.com/search/red%20car%20clipart/",
            "source_domain": "pexels.com"
        }
    ],
    "page": 1,
    "query": "red car",
    "market": {
        "cc": "US",
        "mkt": "en-US",
        "setlang": "en"
    },
    "source": "bing",
    "filters": {
        "size": "large"
    },
    "results_on_page": 1
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | The query is missing, or page, size, layout, type, color, freshness, license, mkt, cc or setlang failed validation. |
| 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)
