Bing Search API — Parse a Bing URL
Documentation menu
FetchLayer FetchLayer API

Parse a Bing URL

Turn a Bing URL into the request fields it encodes, without contacting Bing. A web, news, video, image, shopping or map search page (bing.com/search?q=reddit+api&mkt=en-GB&first=11) comes back as its kind, query, market, country, language, safe search, time range and offset — the 1-based position of the first result it asks for; a result link through Bing (kind result-link) as its destination in targetUrl. Fields the URL does not carry are null. Any other URL is a 400 saying why. Parsing a URL does not consume a credit.

POST /resolve-url Utility
https://api.fetchlayer.dev/bing/resolve-url
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

url string required

A Bing URL: a web, news, video, image, shopping or map search page, or a result link.

format string optional

json or markdown. (default: json)

timeoutMs number optional

Time limit for each page read, in milliseconds (1000–120000).

Response Fields

resolve-url

Parse a Bing URL

resultType string

Always "resolve-url".

url string

The URL you sent.

kind string

search, news, videos, images, shopping, maps or result-link.

query string

The query the URL carries, or null. Pass it to search, news or videos.

market string

The market the URL carries, or null.

country string

The country the URL carries, or null.

language string

The language the URL carries, or null.

safeSearch string

The safe search level the URL carries, or null.

timeRange string

The time range the URL carries, or null.

offset number

The 1-based position of the first result the URL asks for, or null.

targetUrl string

Where a result link leads, or null.

Request

curl -X POST "https://api.fetchlayer.dev/bing/resolve-url" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.bing.com/search?q=reddit+api&mkt=en-GB&first=11"}'

Response

{
  "resultType": "resolve-url",
  "url": "https://www.bing.com/search?q=reddit+api&mkt=en-GB&first=11",
  "query": "reddit api",
  "market": "en-GB",
  "country": null,
  "language": null,
  "safeSearch": null,
  "timeRange": null,
  "offset": 11,
  "targetUrl": null,
  "kind": "search"
}