Scrape Better Business Bureau (BBB) search results with SerpApi's BBB Search API. Search BBB for businesses by name or category, e.g., plumbers or roofing, near a city, ZIP code, or postal code in the United States or Canada, with BBB's filters for accreditation, BBB rating, distance, category, state or province, service area, and quote requests, sorted by relevance, distance, rating, or name. Get each business's name, BBB profile link and IDs, BBB rating and rating score, accreditation, categories, address, GPS coordinates, phone numbers, service areas, local BBB, and quote request link, with the categories and states to filter the search by, and related categories.
Search BBB with a simple GET request:
https://serpapi.com/search?engine=bbb&q=roofing&location=Dallas%2C+TX&api_key=SERPAPI_API_KEY
qis the search query: a business name or a category, anything you'd use in a regular BBB search, e.g.,plumber,roto rooter, orroofing.api_keyis your SerpApi API key. ReplaceSERPAPI_API_KEYwith it.locationis the location to search near, in the United States or Canada: a city with its state or province, or a ZIP or postal code, e.g.,Dallas, TX,91311,Toronto, ON, orM5V 1W2. Without it, BBB returns businesses from anywhere.accredited,rating,distance,category_id,state,serving_my_area, andget_a_quotework like the filters of BBB, e.g.,accredited=true,rating=A,B,distance=25, orstate=CA,NV.sortsets the order of the results:Relevance(default),Distance,Rating,AToZ, orZToA.pagegets the next pages of results. Each page has up to 15 businesses, and BBB returns up to 15 pages.
Use the short form of a location, like on the BBB website. BBB doesn't understand the full names that other SerpApi APIs use, e.g., Austin, Texas, United States, and returns businesses from elsewhere without an error, in this case near United States Coast Guard, CT. A city without its state can also resolve to another city, e.g., Austin to Austin, IN. search_parameters.location_used shows the location BBB searched near, so check it if your locations come from user input. A location BBB doesn't recognize at all, e.g., Qwxzzy, ZZ, returns no businesses and the error "BBB doesn't recognize the location parameter. Use a city with its state or province, or a ZIP or postal code (e.g., Austin, TX)."
distance and serving_my_area need a location: without it, the API returns 400 and, e.g., "distance parameter requires location." Unsupported filter values also return 400, e.g., "Unsupported values for rating parameter: A+" or "Unsupported 7 distance parameter.", while an unknown category_id or state returns no businesses.
Register at SerpApi to get your API key, and keep it private.
Try the request live in the SerpApi Playground.
The code examples read your API key from the SERPAPI_API_KEY environment variable:
export SERPAPI_API_KEY="SERPAPI_API_KEY"Each example searches BBB for roofing businesses near Dallas, TX, and prints the position, title, BBB rating, and accreditation of each business.
Send the request with curl, which prints the full JSON response:
curl --get https://serpapi.com/search \
--data-urlencode engine="bbb" \
--data-urlencode q="roofing" \
--data-urlencode location="Dallas, TX" \
--data-urlencode api_key="$SERPAPI_API_KEY"Install the SerpApi JavaScript library and set your project to use ES modules:
npm install serpapi
npm pkg set type=moduleCreate an index.js file:
import { getJson } from "serpapi";
const results = await getJson({
engine: "bbb",
api_key: process.env.SERPAPI_API_KEY,
q: "roofing",
location: "Dallas, TX",
});
for (const business of results.organic_results ?? []) {
console.log(business.position, business.title, business.bbb_rating ?? "", business.accredited);
}Run it with node index.js.
Install the SerpApi Python library:
pip install serpapiCreate a main.py file:
import os
import serpapi
client = serpapi.Client(api_key=os.getenv("SERPAPI_API_KEY"))
results = client.search({
"engine": "bbb",
"q": "roofing",
"location": "Dallas, TX",
})
for business in results.get("organic_results", []):
print(business["position"], business["title"], business.get("bbb_rating", ""), business["accredited"])Run it with python main.py.
Install the SerpApi Ruby library:
gem install serpapiCreate a main.rb file:
require "serpapi"
client = SerpApi::Client.new(engine: "bbb", api_key: ENV.fetch("SERPAPI_API_KEY"))
results = client.search(q: "roofing", location: "Dallas, TX")
results.fetch(:organic_results, []).each do |business|
puts "#{business[:position]} #{business[:title]} #{business[:bbb_rating]} #{business[:accredited]}"
end
client.closeRun it with ruby main.rb.
Install the SerpApi PHP library:
composer require serpapi/serpapi-phpCreate an index.php file:
<?php
require 'vendor/autoload.php';
use SerpApi\Client;
$client = new Client(getenv('SERPAPI_API_KEY'), 'bbb');
$results = $client->search([
'q' => 'roofing',
'location' => 'Dallas, TX',
]);
foreach ($results->organic_results ?? [] as $business) {
echo $business->position . ' ' . $business->title . ' ' . ($business->bbb_rating ?? '') . ' ' . var_export($business->accredited, true) . PHP_EOL;
}Run it with php index.php.
Create a Go module and install the SerpApi Go library:
go mod init example.com/bbb
go get github.com/serpapi/serpapi-golangCreate a main.go file:
package main
import (
"fmt"
"os"
"github.com/serpapi/serpapi-golang"
)
func main() {
setting := serpapi.NewSerpApiClientSetting(os.Getenv("SERPAPI_API_KEY"))
setting.Engine = "bbb"
client := serpapi.NewClient(setting)
results, err := client.Search(map[string]string{
"q": "roofing",
"location": "Dallas, TX",
})
if err != nil {
panic(err)
}
organicResults, _ := results["organic_results"].([]interface{})
for _, item := range organicResults {
business := item.(map[string]interface{})
rating, _ := business["bbb_rating"].(string)
fmt.Println(business["position"], business["title"], rating, business["accredited"])
}
}Run it with go run ..
Create a Cargo project and add the SerpApi Rust library and Tokio:
cargo new bbb && cd bbb
cargo add serpapi tokio --features tokio/fullReplace src/main.rs with:
use serpapi::serpapi::Client;
use std::collections::HashMap;
use std::env;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut default = HashMap::new();
default.insert("api_key".to_string(), env::var("SERPAPI_API_KEY")?);
default.insert("engine".to_string(), "bbb".to_string());
let client = Client::new(default)?;
let mut parameter = HashMap::new();
parameter.insert("q".to_string(), "roofing".to_string());
parameter.insert("location".to_string(), "Dallas, TX".to_string());
let results = client.search(parameter).await?;
if let Some(organic_results) = results["organic_results"].as_array() {
for business in organic_results {
println!(
"{} {} {} {}",
business["position"],
business["title"].as_str().unwrap_or_default(),
business["bbb_rating"].as_str().unwrap_or_default(),
business["accredited"]
);
}
}
Ok(())
}Run it with cargo run.
Official libraries are also available for Java, .NET, Swift, and C++. See SerpApi integrations for setup guides, or use a simple GET request from any programming language.
Failed requests return an HTTP error status and a JSON body with an error message. The most common are 401 for an invalid API key, 400 for a missing required parameter such as q, and 429 when you exceed your hourly throughput limit or run out of searches. Invalid values also return 400, e.g., "Unsupported rating sort parameter." for a sort value in lowercase, or "page parameter must be an integer between 1 and 15." See API status and error codes for the full list.
A search without businesses still returns 200, with search_metadata.status set to Success, search_information.organic_results_state set to Fully empty, and the error "BBB hasn't returned any results for this query.", so check for error before reading organic_results. This happens for a query nothing matches, e.g., qwxzzyplkvv, for an unknown category_id or state, e.g., state=ZZ, and for a page after the last one, e.g., page 7 of the 84 roofing businesses rated B near Dallas, TX. A location BBB doesn't recognize returns the same, with its own error.
Choose structured JSON for applications or Markdown for LLMs and AI agents:
- JSON is the default output and is useful when you need individual result fields.
- Add
output=mdto receive Markdown instead, which is more token-efficient.
Markdown is plain text, not JSON: YAML front matter with the search metadata and parameters, followed by the number of results, a table of the businesses with their position, title linked to the BBB profile, local BBB ID, business ID, accreditation, BBB rating and score, main category, address, coordinates, phone numbers, thumbnail, local BBB, quote request link, service areas, and headquarters link, tables of the categories and states to filter by, a list of related categories linked to BBB, and links to the other pages. The categories of each business are only in the JSON response. Read the response body as text instead of parsing it.
| Client | Markdown request |
|---|---|
| curl | --data-urlencode output="md" |
| Python | client.search({..., "output": "md"}) |
| PHP | $client->md([...]) |
| Go | client.Md(map[string]string{...}) |
| Rust | client.md(parameter).await? |
If your SDK doesn't have a Markdown helper yet, send a plain HTTP request with output=md and read the body as text. Learn more about Markdown output.
See the BBB Search API documentation for more details.
| Name | Description | Requirement |
|---|---|---|
| Search query | ||
q |
The search query: a business name or a category, anything you'd use in a regular BBB search (e.g., plumber, roto rooter, or roofing). |
Required |
| Geographic location | ||
location |
The location to search near, in the United States or Canada: a city with its state or province, or a ZIP or postal code (e.g., Dallas, TX, Chatsworth, CA, 91311, Toronto, ON, or M5V 1W2). See the BBB locations for 2,346 cities in this format; BBB also accepts other US and Canadian cities. Use the short form, like on the BBB website: full names such as Austin, Texas, United States aren't understood and return businesses from elsewhere, e.g., near United States Coast Guard, CT, and a city without its state can resolve to another city, e.g., Austin to Austin, IN. search_parameters.location_requested shows the location you set, and search_parameters.location_used the location BBB searched near. A location BBB doesn't recognize at all (e.g., Qwxzzy, ZZ) returns no businesses and an error. Without location, businesses from anywhere are returned. |
Optional |
| Advanced filters | ||
accredited |
Set to true to only show BBB accredited businesses, or false (default). Other values are ignored. |
Optional |
rating |
The BBB ratings of the businesses, as a comma-separated list of letters (e.g., A or A,B): A, B, C, D, or F. Each letter includes its plus and minus grades, e.g., A returns businesses rated A+, A, and A-. Grades such as A+ return a 400 error. |
Optional |
distance |
The maximum distance of the businesses from location, in miles: 5, 10, 25, 50, or 100. Other values return a 400 error. Requires location. |
Optional |
category_id |
The categories of the businesses, as a comma-separated list of category IDs (e.g., 10126-200 for Commercial Roofing, or 10113-000,10114-000 for Plumber and Sewer Cleaning). The categories of a search are in filters.categories, and those of each business in its categories. An unknown ID returns no businesses. |
Optional |
state |
The states or provinces of the businesses, as a comma-separated list of codes (e.g., OH or CA,NV). The states of a search are in filters.states. An unknown code returns no businesses. |
Optional |
serving_my_area |
Set to true to only show the businesses that serve the area of location, like the Serving my Area filter of BBB, or false (default). Requires location. |
Optional |
get_a_quote |
Set to true to only show the businesses you can request a quote from, like the Get a Quote filter of BBB, or false (default). Each of them has a request_quote_link. Works with or without location. |
Optional |
| Sorting | ||
sort |
The order of the results: Relevance (default), Distance from location, Rating (best rated first), AToZ (by name, from A to Z), or ZToA (from Z to A). The values are case-sensitive, e.g., rating returns a 400 error. |
Optional |
| Pagination | ||
page |
The page number (e.g., 1 (default) for the first page, 2 for the second). Each page has up to 15 businesses, and BBB returns up to 15 pages, i.e., up to 225 businesses per search, even when total_results is higher. A page after the last one returns no businesses, and a page above 15 returns a 400 error. |
Optional |
| SerpApi parameters | ||
engine |
Set to bbb. |
Required |
api_key |
Your private SerpApi API key. | Required |
no_cache |
Set to true to request fresh results instead of using the one-hour cache. Can't be combined with async. |
Optional |
async |
Set to true for later retrieval through the Searches Archive API. Can't be combined with no_cache or used with Ludicrous Speed enabled. |
Optional |
zero_trace |
Enterprise only. Set to true to skip storing search parameters, files, and metadata on SerpApi servers. |
Optional |
output |
Set to json (default), html for the raw response retrieved from BBB, which is JSON rather than HTML, or md for Markdown. |
Optional |
json_restrictor |
Limit the JSON response to the fields you need. See the JSON Restrictor documentation. | Optional |
Each item in organic_results is a business, with the link to its BBB profile, its BBB rating and accreditation, categories, address, GPS coordinates, phone numbers, and service areas. filters lists the categories and states of the results, to use in category_id and state, and related_categories links to related category pages on BBB. search_information shows the number of results, and serpapi_pagination links to the other pages. The field guides below describe the possible fields and their types; they aren't literal API responses.
Some fields appear only for some businesses or searches:
| Business or search | Fields |
|---|---|
| A business BBB rates | bbb_rating, from A+ to F, e.g., A+, and bbb_rating_score, the score from 0 to 100 that the rating comes from, e.g., 100.0. Businesses BBB doesn't rate have neither |
| A BBB accredited business | accredited set to true, e.g., Ryze, Inc. Other businesses have accredited set to false |
| A business with several locations, e.g., Roto-Rooter | hq_link to the BBB profile of its headquarters, e.g., https://www.bbb.org/us/oh/cincinnati/profile/plumber/roto-rooter-plumbing-water-cleanup-0292-1922, and a link to the location in the results that ends with /addressId/ and the ID of the address. local_bbb_id, business_id, and local_bbb_name are those of the headquarters, e.g., 0292, 1922, and BBB Cincinnati for a Roto-Rooter location in Saint Louis, MO, and can differ from the IDs in link |
| A business that lists the areas it serves | service_areas, e.g., USA for Ryze, Inc., or 311 cities and ZIP codes for Roto-Rooter, and sometimes service_area, its own description, e.g., (Nationwide - See attached list of branches and locations) |
| A business you can request a quote from on BBB | request_quote_link, e.g., https://www.bbb.org/wyoming-and-northern-colorado/quote/request-roto-rooter-34019576. With get_a_quote=true, every business has one |
| A business with a logo on BBB | thumbnail with a link to the logo |
| A business with a phone number | phone with the main one, and phones with all of them, starting with phone. A few businesses have neither |
A search without location |
filters.states with up to 50 states and provinces, instead of the few around location, e.g., OK and TX for Dallas, TX |
The link of a business with one location ends with its local_bbb_id and business_id, e.g., https://www.bbb.org/us/tx/austin/profile/coffee-and-tea/ryze-inc-0825-1000235729 for Ryze, Inc., and the links of Canadian businesses start with https://www.bbb.org/ca/. local_bbb_id and business_id together identify a business. search_metadata.bbb_url links to the same search on BBB, e.g., https://www.bbb.org/search?find_text=roofing&find_loc=Dallas%2C+TX&page=1. search_information.total_results is the number of businesses BBB matched, e.g., 8187 for roofing near Dallas, TX, but only the first 225 are available, on 15 pages.
To get the next page, increase page or follow serpapi_pagination.next. position counts the previous pages, e.g., 16 to 30 on page 2 and 211 to 225 on page 15. serpapi_pagination.other_pages links to the other pages, up to the last one or page 15, and the last page has no next.
Each business in organic_results can include these fields:
{
"organic_results": [
{
"position": "Integer - Position of the business in the results, counting the previous pages, e.g., 16 for the first business on page 2",
"title": "String - Name of the business, e.g., Ryze, Inc.",
"link": "String - Link to the BBB profile of the business, at the location in the results, e.g., https://www.bbb.org/us/tx/austin/profile/coffee-and-tea/ryze-inc-0825-1000235729",
"hq_link": "String - Link to the BBB profile of the headquarters of a business with several locations",
"local_bbb_id": "String - ID of the local BBB that the business profile belongs to, e.g., 0825",
"business_id": "String - ID of the business at its local BBB, e.g., 1000235729",
"accredited": "Boolean - true if the business is BBB accredited",
"bbb_rating": "String - BBB rating of the business, from A+ to F, e.g., A+",
"bbb_rating_score": "Float - Score from 0 to 100 that the BBB rating comes from, e.g., 100.0",
"category": "String - Main category of the business, e.g., Coffee and Tea",
"categories": [
{
"id": "String - ID of the category, to use in category_id, e.g., 50164-000",
"title": "String - Name of the category, e.g., Coffee and Tea"
}
],
"address": "String - Address of the business, e.g., 600 Congress Ave Fl 14, Austin, TX 78701-3263",
"gps_coordinates": {
"latitude": "Float - Latitude of the business, e.g., 30.26809",
"longitude": "Float - Longitude of the business, e.g., -97.74291"
},
"phone": "String - Main phone number of the business",
"phones": "Array[String] - All the phone numbers of the business",
"thumbnail": "String - Link to the logo of the business",
"service_area": "String - Service area, as written by the business, e.g., (Nationwide - See attached list of branches and locations)",
"service_areas": "Array[String] - Cities, counties, states, or countries that the business serves, e.g., USA",
"local_bbb_name": "String - Name of the local BBB that the business profile belongs to, e.g., BBB Heart of Texas",
"request_quote_link": "String - Link to request a quote from the business on BBB, like the Get a Quote button of BBB"
}
]
}position, title, link, local_bbb_id, business_id, accredited, category, categories, address, gps_coordinates, and local_bbb_name are on every business. categories has up to 4 categories, starting with category, so a business found with a category_id filter doesn't always list that category, e.g., only 8 of the 15 businesses on the first page with category_id=10126-200 (Commercial Roofing) near Dallas, TX list it. Some gps_coordinates are approximate, e.g., rounded to 2 decimals. BBB cuts service_area after 300 characters of its HTML text, so a long one can end in the middle of a word or of an HTML entity, e.g., with &nb.
filters lists the categories and states of the results, and related_categories links to related categories on BBB:
{
"filters": {
"categories": [
{
"text": "String - Name of the category, e.g., Commercial Roofing",
"value": "String - ID of the category, to use in category_id, e.g., 10126-200"
}
],
"states": [
{
"text": "String - State or province code, e.g., TX",
"value": "String - State or province code, to use in state, e.g., TX"
}
]
},
"related_categories": [
{
"title": "String - Name of the related category, e.g., Roofing Contractors",
"link": "String - Link to the category page on BBB, e.g., https://www.bbb.org/us/tx/dallas/category/roofing-contractors"
}
]
}filters.categories and related_categories have up to 10 categories each, e.g., Roofing Contractors, Commercial Roofing, and Metal Roofing Contractors for roofing near Dallas, TX.
search_information describes the search, and serpapi_pagination links to the other pages:
{
"search_information": {
"total_results": "Integer - Number of businesses matching the search, e.g., 8187",
"organic_results_state": "String - Fully empty when no business matches the search"
},
"serpapi_pagination": {
"current": "Integer - Current page",
"previous": "String - SerpApi link to the previous page",
"next": "String - SerpApi link to the next page",
"other_pages": {
"2": "String - SerpApi link to page 2, for every other page up to the last one or page 15"
}
}
}A search without businesses has organic_results_state and an error, but no organic_results, filters, related_categories, or serpapi_pagination. With a location BBB doesn't recognize, it also has no total_results.
Give AI agents and assistants a BBB business search tool with the hosted SerpApi MCP server at https://mcp.serpapi.com/mcp.
Claude Code:
claude mcp add --transport http serpapi https://mcp.serpapi.com/mcp --header "Authorization: Bearer $SERPAPI_API_KEY"Codex, which reads the key from SERPAPI_API_KEY:
codex mcp add serpapi --url https://mcp.serpapi.com/mcp --bearer-token-env-var SERPAPI_API_KEYOther MCP clients:
{
"mcpServers": {
"serpapi": {
"type": "http",
"url": "https://mcp.serpapi.com/SERPAPI_API_KEY/mcp"
}
}
}The server's engine catalog includes the bbb engine, and its serpapi://engines/bbb resource describes the parameters. Ask your agent to check the BBB ratings of roofing contractors near Dallas, TX, with the bbb engine. The resulting tool call looks like this:
{
"name": "search",
"arguments": {
"params": {
"engine": "bbb",
"q": "roofing",
"location": "Dallas, TX"
}
}
}See the MCP integration guide for more clients and self-hosting.
Search BBB from your terminal or from AI agent workflows with the SerpApi CLI:
brew tap serpapi/homebrew-tap
brew install serpapi-cliThe CLI picks up SERPAPI_API_KEY from your environment. You can also run serpapi login to save a key.
serpapi search engine=bbb q=roofing location="Dallas, TX"
serpapi search engine=bbb q=roofing location="Dallas, TX" accredited=true sort=Rating --fields "organic_results[].{title, bbb_rating, bbb_rating_score, accredited, link}"
serpapi search engine=bbb q=roofing location="Dallas, TX" output=mdUse SerpApi APIs without writing code:
- Vet a contractor before hiring it: check its BBB rating, rating score, and accreditation, e.g., with
q=roto rooterand your city inlocation, and open its BBB profile fromlink. - Find accredited, well-rated businesses near a location, e.g., roofers within 25 miles of Dallas, TX, with
accredited=true,rating=A, anddistance=25. - Track where your own business appears for a category search in your area, e.g., roofing near Dallas, TX, and how BBB rates it, by its
linkandpositionacross pages. - Compare the BBB ratings and rating scores of the businesses in a category near you, e.g., Commercial Roofing near Dallas, TX, with
category_id=10126-200andsort=Rating. - Check that your vendors and suppliers are BBB accredited, and how BBB rates them, before signing or renewing a contract.
- Give AI agents a tool to check the BBB rating and accreditation of a business, e.g., for "an accredited roofer near Dallas, TX, rated A or above".
- Google Maps Scraper: local businesses with their address, hours, and ratings from Google Maps
- Google Local Scraper: local results from Google Search
- Apple Maps Scraper: places on Apple Maps
Feel free to reach out at contact@serpapi.com.
