---
title: "Search Bing"
method: POST
path: "/v1/microsoft/search"
tags: ["Bing"]
---

# Search Bing

`POST /v1/microsoft/search`

## Request

- Base URL: `https://api.prismcrawl.com`
- URL: `https://api.prismcrawl.com/v1/microsoft/search`
- Auth: API key in header `x-api-key`

Returns normalized Bing results, or encoded source HTML.

## Request body

- MicrosoftSearchRequest
  - `output` 'json' | 'html' | 'md' | 'null', nullable: Response content format. md returns Markdown in data.content with data.format=md; the JSON success/request envelope remains. Accept: text/markdown also selects Markdown unless output or html=true is explicit. html is an alias for html=true and retains the existing Brotli/Base64 source format.
  - `json_restrictor` string, nullable: Select fields within data.content for JSON or Markdown. Supports comma-separated paths, non-negative array indices, half-open slices [0:3] (either bound may be omitted), [] and .{nested,subqueries}. Up to128 selections and16 levels. Missing fields are omitted; selected declared fields retain their zero defaults. The request envelope and credit headers remain. Include next_page_token when pagination is needed. Incompatible with HTML output. This changes response presentation only; tracing-enabled history retains the complete JSON result.
  - `no_cache` boolean, nullable: Accepted for compatibility. Searches are always fetched without a result cache for either value; normal successful-request billing applies.
  - `query` string, required: The search query. The UTF-8 representation must not exceed 8,192 bytes; non-ASCII characters may use more than one byte.
  - `html` boolean, nullable: Return Brotli-compressed, Base64-encoded source HTML instead of normalized JSON.
  - `zero_trace` boolean, nullable: When true, PrismCrawl does not store the source HTML or parsed JSON. Audit and billing metadata is retained, but all other data is permanently discarded. Request history exposes only type `ZERO_TRACE`, the request HTTP status code, and whether the account was charged.
  - `device` 'mobile' | 'tablet' | 'desktop' | 'null', nullable: Search as a mobile, tablet, or desktop device.
  - `safe` 'active' | 'off' | 'null', nullable: Safe-search mode. `active` enables Google's filtering and Bing Strict SafeSearch; `off` requests unfiltered results. Search providers may still suppress content required by law or policy.
  - `color_scheme` 'light' | 'dark' | 'null', nullable: Request the provider's light or dark result-page theme. This affects source-page presentation, not ranking, and providers may ignore it.
  - `sp` -1 | null, nullable: Bing-native spelling hint. The supported value is `-1`, an undocumented field observed in Bing-generated search URLs. Its behavior is best-effort and may change upstream.
  - `first` integer, nullable: Bing's one-based native page position. Omit it or use `1` for the front page. Values greater than `1` require the `next_page_token` returned by the preceding response and must match that token; arbitrary offsets are rejected.
  - `next_page_token` string, nullable: Opaque Bing continuation token from the preceding response, valid for one hour and the same account. When supplied, `first` may be omitted. Resend the same query, device, targeting, time range, and search controls. Restart pagination if the token is expired, rejected, or predates the authenticated-token rollout.
  - `cc` 'ar' | 'au' | 'at' | 'be' | 'br' | 'ca' | 'cl' | 'dk' | 'fi' | 'fr' | 'de' | 'hk' | 'in' | 'id' | 'it' | 'jp' | 'kr' | 'my' | 'mx' | 'nl' | 'nz' | 'no' | 'cn' | 'pl' | 'pt' | 'ph' | 'ru' | 'sa' | 'za' | 'es' | 'se' | 'ch' | 'tw' | 'tr' | 'gb' | 'us' | 'null', nullable: Two-letter Bing result-country code. Case-insensitive. The supported values follow Bing's published country-code list.
  - `location` string, nullable: Named geographic search origin, resolved to coordinates. At most 512 UTF-8 bytes without control characters. Mutually exclusive with coordinates; resend the same name when paginating. Bing may also consider the query and other location signals.
  - `mkt` string, nullable: Bing result market. Case-insensitive; mutually exclusive with cc. Resend it when paginating.
  - `filters` string, nullable: Native Bing filters copied from its search URL. At most 4096 UTF-8 bytes without control characters. Mutually exclusive with tbs; resend exactly when paginating.
  - `setlang` string, nullable: Bing interface-language hint. It affects Bing-generated interface strings, such as related-search labels; it does not restrict search results to that language. Bing may fall back to English when it cannot localize a value. See Microsoft's current [`set_lang` guidance](https://learn.microsoft.com/en-us/azure/foundry/agents/how-to/tools/bing-tools#optional-parameters).
  - `coordinates` Coordinates
    - `latitude` number, double, required
    - `longitude` number, double, required
  - `tbs` string, nullable: Google-compatible time-range input translated to Bing's native date filter. Relative ranges use `qdr:<unit>[amount]`, where the unit is `d` (day), `w` (week), `m` (month), or `y` (year), and the optional positive amount is at most 10,000. Custom inclusive ranges use `cdr:1,cd_min:M/D/YYYY,cd_max:M/D/YYYY`. Bing has day-level precision, so hour ranges (`qdr:h`) are rejected. Resend the same value with a filtered search's `next_page_token`.

## Response `200`

Search completed.

- union
  - MarkdownSearchResponse
    - `success` union, required
      - unknown
      - true
    - `request_id` union, required
      - ''
      - string, uuid
    - `data` MarkdownSearchData, required
      - `format` union, required
        - ''
        - 'md'
      - `content` string, required: Markdown derived from the parsed result, after any json_restrictor selection.
  - ProjectedSearchResponse
    - `success` union, required
      - unknown
      - true
    - `request_id` union, required
      - ''
      - string, uuid
    - `data` ProjectedSearchData, required
      - `format` union, required
        - ''
        - 'json'
      - `content` object, required: Only fields selected by json_restrictor. Selected fields retain their declared types and zero defaults.
  - MicrosoftJsonSearchResponse
    - `success` union, required
      - unknown
      - true
    - `request_id` union, required
      - ''
      - string, uuid
    - `data` MicrosoftJsonSearchData, required
      - `format` union, required
        - ''
        - 'json'
      - `content` MicrosoftSearchContent, required
        - `has_next_page` boolean, required: Whether the returned provider HTML advertises another results page.
        - `results` object[], required
          - `classification` object, required
            - `content_type` string, required
            - `source_hint` string, required
          - `display_url` string, required
          - `domain` string, required
          - `domain_info` object, required
            - `category` string, required
            - `sld` string, required
            - `tld` string, required
          - `engine` string, required
          - `favicon` string, required
          - `id` string, required
          - `position` object, required
            - `absolute` integer, required
          - `rank` integer, required
          - `snippet` string, required
          - `source_name` string, required
          - `thumbnail` string, required
          - `title` string, required
          - `tracking_url` string, required
          - `type` string, required
          - `url` string, required
        - `search_parameters` object, required
          - `cc` string, required
          - `color_scheme` string, required
          - `coordinates` object, required
            - `latitude` number, required
            - `longitude` number, required
          - `device` string, required
          - `engine` string, required
          - `filters` string, required
          - `first` integer, required
          - `location` string, required
          - `mkt` string, required
          - `q` string, required
          - `safe` string, required
          - `setlang` string, required
          - `sp` integer, required
          - `tbs` string, required
          - `type` string, required
        - `serp_features` object[], required
          - `confidence` number, required
          - `engine` string, required
          - `extracted_at` string, required
          - `id` string, required
          - `items` object[], required
            - `link` string, required
            - `product_id` string, required
            - `text` string, required
            - `thumbnail` string, required
            - `title` string, required
          - `links` object[], required
            - `title` string, required
            - `url` string, required
          - `position` object, required
            - `absolute` integer, required
          - `source_result_ids` string[], required
          - `text` string, required
          - `title` string, required
          - `type` string, required
      - `next_page_token` string, required: Opaque Bing continuation token, or an empty string when no further native page is advertised. Use the same account and search parameters. Tokens expire after one hour; restart pagination when expired. Tokens issued before the authenticated-token rollout must also be replaced by starting a new search.
      - `pagination_limited` boolean, required: True when usable results were returned but their native continuation cannot be supported. next_page_token is an empty string.
  - MicrosoftHtmlSearchResponse
    - `success` union, required
      - unknown
      - true
    - `request_id` union, required
      - ''
      - string, uuid
    - `data` MicrosoftHtmlSearchData, required
      - `format` union, required
        - ''
        - 'html+br+base64'
      - `content` string, byte, required: Base64-encoded bytes. Decode Base64 first, then decompress the result with Brotli. Available deferred or lazy-loaded thumbnail sources are placed in image src attributes, within size limits; image and video files are not downloaded.
      - `next_page_token` string, required: Opaque Bing continuation token, or an empty string when no further native page is advertised. Use the same account and search parameters. Tokens expire after one hour; restart pagination when expired. Tokens issued before the authenticated-token rollout must also be replaced by starting a new search.
      - `pagination_limited` boolean, required: True when usable source HTML was returned but its native continuation cannot be supported. next_page_token is an empty string.

## Other responses

- `400`: The JSON body, source selection, or continuation is invalid. Locally malformed, forged, expired, or mismatched tokens are rejected before source work and require restarting pagination. A source may also reject an otherwise well-formed selector after acquisition. These errors do not spend a search credit. Source inventory changes discovered during a valid request return a completed response instead.
- `401`: The API token is missing, invalid, expired, or revoked.
- `402`: The API token has no credits remaining.
- `405`: Only POST is supported for this endpoint.
- `413`: The JSON request body exceeds 64 KiB.
- `429`: Rate limit exceeded.
- `500`: The request could not be completed.

---

[API](https://skmtc.dev/prismcrawl/apis/prismcrawl-api.md) · [All operations](https://skmtc.dev/prismcrawl/apis/prismcrawl-api/llms.txt) · [OpenAPI document](https://skmtc.dev/prismcrawl/apis/prismcrawl-api/revisions/eef17f6c02a5?raw)
