Search
The bing_search
source is designed to retrieve Bing Search results pages (SERPs).
To scrape AI-generated search results from Bing, use the render
parameter.
Request samples
In the example below, we make a request to retrieve Bing search results for the search term adidas
. The search will start from the 11th page and retrieve 10 pages of results, which will be delivered in a structured format.
curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
"source": "bing_search",
"domain": "com",
"query": "adidas",
"start_page": 11,
"pages": 10,
"callback_url": "https://your.callback.url",
"parse": true
}'
import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'bing_search',
'domain': 'com',
'query': 'adidas',
'start_page': 11,
'pages': 10,
'callback_url': 'https://your.callback.url',
'parse': True
}
# Get response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('USERNAME', 'PASSWORD'),
json=payload,
)
# Print prettified response to stdout.
pprint(response.json())
const https = require("https");
const username = "USERNAME";
const password = "PASSWORD";
const body = {
source: "bing_search",
domain: "com",
query: "adidas",
start_page: 11,
pages: 10,
callback_url: "https://your.callback.url",
parse: true,
};
const options = {
hostname: "realtime.oxylabs.io",
path: "/v1/queries",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization:
"Basic " + Buffer.from(`${username}:${password}`).toString("base64"),
},
};
const request = https.request(options, (response) => {
let data = "";
response.on("data", (chunk) => {
data += chunk;
});
response.on("end", () => {
const responseData = JSON.parse(data);
console.log(JSON.stringify(responseData, null, 2));
});
});
request.on("error", (error) => {
console.error("Error:", error);
});
request.write(JSON.stringify(body));
request.end();
https://realtime.oxylabs.io/v1/queries?source=bing_search&domain=com&query=adidas&start_page=11&pages=10&parse=true&access_token=12345abcdep
<?php
$params = array(
'source' => 'bing_search',
'domain' => 'com',
'query' => 'adidas',
'start_page' => 11,
'pages' => 10,
'callback_url' => 'https://your.callback.url',
'parse' => true
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://realtime.oxylabs.io/v1/queries");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "USERNAME" . ":" . "PASSWORD");
$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo $result;
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
const Username = "USERNAME"
const Password = "PASSWORD"
payload := map[string]interface{}{
"source": "bing_search",
"domain": "com",
"query": "adidas",
"start_page": 11,
"pages": 10,
"callback_url": "https://your.callback.url",
"parse": true,
}
jsonValue, _ := json.Marshal(payload)
client := &http.Client{}
request, _ := http.NewRequest("POST",
"https://realtime.oxylabs.io/v1/queries",
bytes.NewBuffer(jsonValue),
)
request.SetBasicAuth(Username, Password)
response, _ := client.Do(request)
responseText, _ := ioutil.ReadAll(response.Body)
fmt.Println(string(responseText))
}
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;
namespace OxyApi
{
class Program
{
static async Task Main()
{
const string Username = "USERNAME";
const string Password = "PASSWORD";
var parameters = new {
source = "bing_search",
domain = "com",
query = "adidas",
start_page = 11,
pages = 10,
callback_url = "https://your.callback.url",
parse = true
};
var client = new HttpClient();
Uri baseUri = new Uri("https://realtime.oxylabs.io");
client.BaseAddress = baseUri;
var requestMessage = new HttpRequestMessage(HttpMethod.Post, "/v1/queries");
requestMessage.Content = JsonContent.Create(parameters);
var authenticationString = $"{Username}:{Password}";
var base64EncodedAuthenticationString = Convert.ToBase64String(System.Text.ASCIIEncoding.UTF8.GetBytes(authenticationString));
requestMessage.Headers.Add("Authorization", "Basic " + base64EncodedAuthenticationString);
var response = await client.SendAsync(requestMessage);
var contents = await response.Content.ReadAsStringAsync();
Console.WriteLine(contents);
}
}
}
package org.example;
import okhttp3.*;
import org.json.JSONObject;
import java.util.concurrent.TimeUnit;
public class Main implements Runnable {
private static final String AUTHORIZATION_HEADER = "Authorization";
public static final String USERNAME = "USERNAME";
public static final String PASSWORD = "PASSWORD";
public void run() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("source", "bing_search");
jsonObject.put("domain", "com");
jsonObject.put("query", "adidas");
jsonObject.put("start_page", 11);
jsonObject.put("pages", 10);
jsonObject.put("callback_url", "https://your.callback.url");
jsonObject.put("parse", true);
Authenticator authenticator = (route, response) -> {
String credential = Credentials.basic(USERNAME, PASSWORD);
return response
.request()
.newBuilder()
.header(AUTHORIZATION_HEADER, credential)
.build();
};
var client = new OkHttpClient.Builder()
.authenticator(authenticator)
.readTimeout(180, TimeUnit.SECONDS)
.build();
var mediaType = MediaType.parse("application/json; charset=utf-8");
var body = RequestBody.create(jsonObject.toString(), mediaType);
var request = new Request.Builder()
.url("https://realtime.oxylabs.io/v1/queries")
.post(body)
.build();
try (var response = client.newCall(request).execute()) {
if (response.body() != null) {
try (var responseBody = response.body()) {
System.out.println(responseBody.string());
}
}
} catch (Exception exception) {
System.out.println("Error: " + exception.getMessage());
}
System.exit(0);
}
public static void main(String[] args) {
new Thread(new Main()).start();
}
}
{
"source": "bing_search",
"domain": "com",
"query": "adidas",
"start_page": 11,
"pages": 10,
"callback_url": "https://your.callback.url",
"parse": true
}
We use synchronous Realtime integration method in our examples. If you would like to use Proxy Endpoint or asynchronous Push-Pull integration, refer to the integration methods section.
In the following example, we send a request to retrieve AI-generated Bing search results for the search term best seo tools
.
{
"source": "bing_search",
"query": "best seo tools",
"render": "html"
}
Request parameter values
Generic
Basic setup and customization options for Bing search scraping.
- mandatory parameter
Localization
Adapt search results to specific geographical locations, domains, and languages.
Pagination
Controls for managing the pagination and retrieval of search results.
Structured data
SERP Scraper API is capable of extracting either an HTML or JSON object that contains Bing search results, offering structured data on various elements of the results page.
Output data dictionary
HTML example
JSON structure
The table below presents a detailed list of each SERP feature we parse, along with its description and data type. The table also includes some metadata.
In the following sections, parsed JSON code snippets are shortened where more than one item for the result type is available.
Paid
...
"paid": [
{
"pos": 1,
"url": "https://www.bing.com/aclick?ld=e8TB2-TOVbuwbSri4984NcRjVUCUyQghxnzejHV59xXn6r9lgz7ciPH0EL82ftdUCMBGEyAqiFGOiPXPkAOfdD7Y-Xpb6_pZlMPNZ2x6tTn4WAr8KA0oPNQYW031wP0d8g-pQsdx7BmXEN9ZojHVTY7Jznw7BafmzDSQCtL-MgYN9BRUmeBp74Eo3wYCJfbPIT_cWI2g&u=aHR0cCUzYSUyZiUyZnd3dy5yZW1pc2VzZW5saWduZS5mciUyZmJhc2tldC1uaWtlLWpvcmRhbiUzZnRhcmdldGlkJTNka3dkLTg1MTQ0NzUwMTM5NzExJTI2bWF0Y2h0eXBlJTNkcCUyNmRldmljZSUzZGMlMjZjYW1wYWlnbmlkJTNkNTMxMzY2ODQ3JTI2Y3JlYXRpdmUlM2QlMjZhZGdyb3VwaWQlM2QxMzYyMjk3NDM4ODkzNDg1JTI2ZmVlZGl0ZW1pZCUzZCUyNmxvY19waHlzaWNhbF9tcyUzZDE0MzAyNyUyNmxvY19pbnRlcmVzdF9tcyUzZCUyNm5ldHdvcmslM2RvJTI2ZGV2aWNlbW9kZWwlM2QlMjZwbGFjZW1lbnQlM2QlMjZrZXl3b3JkJTNkJTI0YmFza2V0JTI1MjBuaWtlJTI1MjBqb3JkYW4lMjZ0YXJnZXQlM2QlMjZhZHBvc2l0aW9uJTNkJTI2dHJhY2tpZCUzZGZyX2FsbF9kZWFsc18yX2JpbmclMjZtSWQlM2RIMTQ5MDAzQ1FOJTI2bXNjbGtpZCUzZDc5NjY4ODI4MDQ0ODE2NjVjNTJmZWU0MTc4Yjk1NWJm&rlid=7966882804481665c52fee4178b955bf",
"desc": "Neue Releases, Retro-Klassiker & zeitlose Ikonen. Entdecke Air Jordan bei Nike. Meistere das Spiel und erlebe Tradition neu mit Air Jordan von Nike.",
"title": "Offizielle Air Jordan Webseite | Shoppe Nike Jumpman-Produkte",
"url_shown": "www.nike.com/air/jordan",
"pos_overall": 11
},
{
"pos": 2,
"url": "https://www.bing.com/aclick?ld=e8OBM60EyxdN2Qxvp-arD9JzVUCUwier4bXHLFD_dsME5lB1Pg9YnfVggGJSi3ORhgEF-Gwzqx3PiuxHd6fxx0MXN6JKmkwjaGnD2ROEo6W3eTA9fAn8bfi9vpeZ8xEeTyyq8sKhHcKj58HK6h9JnOT7G7zLTYg6MFHaWaGo06uKP4G58bRvFt98DUBKhWj8fd_L867A&u=aHR0cHMlM2ElMmYlMmZ3d3cuYW1hem9uLmNvbSUyZnMlMmYlM2ZpZSUzZFVURjglMjZrZXl3b3JkcyUzZHdvbWVuJTI1MjdzJTJiYWlyJTJiam9yZGFuJTJicmV0cm8lMmIxJTJiZWxldmF0ZSUyYmxvdyUyYmNhc3VhbCUyYnNob2VzJTI2aW5kZXglM2RhcHMlMjZ0YWclM2RtaDBiLTIwJTI2cmVmJTNkcGRfc2xfM2ltOXJscjRkb19iJTI2YWRncnBpZCUzZDEzMzkyMDc1NjMwMTkxMTIlMjZodmFkaWQlM2Q4MzcwMDczNjAyNTQ5NiUyNmh2bmV0dyUzZG8lMjZodnFtdCUzZGIlMjZodmJtdCUzZGJiJTI2aHZkZXYlM2RjJTI2aHZsb2NpbnQlM2QlMjZodmxvY3BoeSUzZDE0MzAyNyUyNmh2dGFyZ2lkJTNka3dkLTgzNzAxNTIzNzAwNjc0JTI2aHlkYWRjciUzZDgwNDJfMTM0Njc2MjQlMjZtc2Nsa2lkJTNkMTg4YzJhMmJhNzg0MWE2MWExY2M0YzQyZGI3NWJhMTU&rlid=188c2a2ba7841a61a1cc4c42db75ba15",
"desc": "Sneakers und Mehr bei Foot Locker Online. Premium Kollektionen und Bekleidung!",
"title": "Jordan - Foot Locker Germany | Foot Locker Germany",
"url_shown": "www.footlocker.de",
"pos_overall": 12
}
],
...
Organic
...
"organic": [
{
"pos": 1,
"url": "https://www.bing.com/ck/a?!&&p=dfe8ec2f6aa2c9deJmltdHM9MTcxODU4MjQwMCZpZ3VpZD0wNzdiZTI5My05ZWM4LTZkNWYtMDE0Ni1mNjMyOWZmMzZjMDEmaW5zaWQ9NTIwOA&ptn=3&ver=2&hsh=3&fclid=077be293-9ec8-6d5f-0146-f6329ff36c01&psq=nike+jordan+shoes&u=a1aHR0cHM6Ly93d3cubmlrZS5jb20vcGgvdy9qb3JkYW4tc2hvZXMtMzdlZWZ6eTdvaz9tc29ja2lkPTA3N2JlMjkzOWVjODZkNWYwMTQ2ZjYzMjlmZjM2YzAx&ntb=1",
"desc": "WEBFind Jordan Shoes at Nike.com. Free delivery and returns on select orders.",
"title": "Jordan Shoes. Nike PH",
"url_shown": "https://www.nike.com/ph/w/jordan-shoes-37eefzy7ok",
"pos_overall": 1
},
...
Last updated