Learn about Bright Data’s SERP API solution, how to get started, and some tips for best use.
Bright Data's SERP API
SERP API is one of our proxy-unlocking solutions and is designed to help you focus on your data collection from search engine results pages (SERPs) while we take care of the full proxy, unblocking, and parsing infrastructure for you.
You send a single proxy request to the specific search engine you want to target and we'll return to you a clean parsed (or unparsed) HTML/JSON back. It’s that simple.
Behind the scenes, our SERP API's robust platform manages the entire scraping and unblocking flow, from selecting the optimal proxy network, to customing headers, fingerprinting, solving CAPTCHAs, and at the end returning back a clean structured HTML or parsed JSON.
Best for
- Scraping search engines, such as Google, Bing, DuckDuckGo, Yandex, Baidu, Yahoo, and Naver Search APIs
- Organic keyword tracking, brand protection, price comparison, market research, detect copyright infringements, ad intelligence
- Making multiple concurrent requests
Please note: If you are looking for an unlocking solution to target and scrape regular web pages and not SERPs, check out our Web Unlocker.
Quick start
-
Sign in to your Bright Data control panel
- If you haven’t yet signed up for Bright Data, you can sign up for free, and when adding your payment method, you’ll receive a $5 credit to get you started!
-
Create your new SERP API zone
-
- Navigate to ‘My Proxies’ page, and under ‘SERP API’ click ‘Get started'
Note: If you already have an active proxy, simply choose ‘Add proxy’ at the top right and select SERP API.
-
Adding your new SERP API proxy zone
- In the ‘Create a new proxy” page, choose and input a name for your new SERP API zone.
Note: Choose a meaningful name for your zone, as it cannot be changed once created. - Allow hotel requests - Enable this if you are looking to target hotel data from Google Travel (google.com/travel). Learn more about how to target Google's hotel SERP service.
- Ads mode - A Google-specific feature that enables users to control the display of ads within search results:
- Off - Retrieves organic search results and ads. The number of ads included in the response is relatively low, and the results cover a wide geographical area.
- On - Retrieves more varied results, simulating an incognito browsing experience with no cookies.
- Adtest - Retrieves only ads in the SERP response and no organic results. This is a tool for testing ads where the '&adtest=on' parameter is automatically added to the search query. See an example of this here.
- Asynchronous requests - Send requests without waiting for the responses. A 'response ID' is returned and we take care of the request behind the scenes, allowing you to collect your responses at a later more convenient time via a designated API endpoint.
Recommended for: those with high-volume requests as this mode has the best stability, flexibility, and 99.99% success rate.
To create and save your proxy, click ‘Add proxy’
- In the ‘Create a new proxy” page, choose and input a name for your new SERP API zone.
A note on Account verification:
If you haven’t yet added a payment method, you’ll be prompted to add one at this point in order to verify your account. If it’s your first time using Bright Data, then you’ll also receive a $5 bonus credit to get you started!
Be advised: You will not be charged anything at this point and this is solely for verification purposes.
4. Retrieving your SERP API credentials
After creating your SERP API zone and verifying your account, it's time to get your credentials so you can send your first SERP API request. You can get your credentials in two ways:
- In your proxy zone’s ‘Access parameters’ tab, you’ll find your credentials which include your Username (Customer_ID), Zone name (attached to username), and Password
- SERP API playground - A user-friendly test platform where you can preview your credentials, request, and retrieve and visually view SERP responses (for free!). It can help you generate a customized search query for your needs that can be easily integrated into your code and see how our parsed response looks.
5. Sending your first SERP API request
Now that you've received your credentials in one of the above methods, it's time to send your first request:
- Copy the ‘Base CURL’ test example in the black code block on the 'Access parameters' page or the curl request from the SERP API playground and paste it into your CMD prompt
- It should look like the following but with your credentials already swapped in:
curl --proxy brd.superproxy.io:22225 --proxy-user brd-customer-<CUSTOMER_ID>-zone-<ZONE_NAME>:<ZONE_PASSWORD> -k https://www.google.com/search?q=pizza
- Press ‘Enter’ to send your request and if it’s successful, the expected response will be a full HTML from Google of the query "pizza"
- Now, simply try it with any search domain and query you would like to target, replacing “https://www.google.com/search?q=pizza” above with your target domain. That's it!
Note on asynchronous requests: The above request is a synchronous request (the response is received in real-time). If you are looking to send an asynchronous request see here.
6. Returning a parsed JSON response
- By default, a SERP API response returns an unparsed structured HTML of the targeted SERP. If you would like to receive a parsed JSON response, add one of the following parameters at the end of your search query:
- “brd_json=1” - Returns a single parsed JSON (instead of a raw HTML)
-
curl --proxy brd.superproxy.io:22225 --proxy-user brd-customer-<CUSTOMER_ID>-zone-<ZONE_NAME>:<ZONE_PASSWORD> -k "https://www.google.com/search?q=pizza&brd_json=1"
-
- “brd_json=html” - Returns a single parsed JSON which contains an "html" field (with the raw HTML in addition to the other parsed fields)
-
curl --proxy brd.superproxy.io:22225 --proxy-user brd-customer-<CUSTOMER_ID>-zone-<ZONE_NAME>:<ZONE_PASSWORD> -k "https://www.google.com/search?q=pizza&brd_json=html"
-
- Note: Parsing is supported for both Google and Bing search engines
- “brd_json=1” - Returns a single parsed JSON (instead of a raw HTML)
Additional info and resources
SERP API Playground
A free interactive tool to customize your search request and preview the results live in JSON and HTML
Parsing - The Ins and Outs
Explore the types of data we extract from a raw SERP HTML and see how you can put this parsed data to good use
How To
Find out more about the different targeting options, control panel actions, and more using Bright Data’s SERP API.
API Documentation
Analyze more advanced SERP API documentation and see more use cases and features
FAQ
Check out our frequently asked questions regarding SERP API
Pricing & Billing
See more about how your requests are calculated and priced
Note: SERP API only charges for successful requests