GETapi.synup.com/api/v4/gbp-categories
Get GBP Categories
This API retrieves the Google Business Profile (GBP) categories available in a country. Use the siteCategoryId (GCID) of a category as primaryGbpSiteCategoryId or in additionalGbpSiteCategoryIds when you create or update a location in that country.
countryIso is required. Pass siteCategoryId as well to look up a single category, e.g. to check that a GCID is valid in that country before using it.
Requires an API key. Send it as
Authorization: API <your-key> — see Getting started.Parameters
Query
| Name | Type | Required | Description |
|---|---|---|---|
countryIso | string | required | Required. ISO 3166-1 alpha-2 code of the country (case-insensitive), e.g. US. Returns the categories available for locations in this country. |
siteCategoryId | string | optional | Optional. A Google category ID (GCID), e.g. gcid:bakery. Returns only this category. Returns an error if it is not a GBP category in the given country. |
Request
Request
curl -X GET 'https://api.synup.com/api/v4/gbp-categories?countryIso=&siteCategoryId=' \
-H 'Authorization: API YOUR_API_KEY' \
-H 'Content-Type: application/json'const res = await fetch('https://api.synup.com/api/v4/gbp-categories?countryIso=&siteCategoryId=', {
method: 'GET',
headers: {
Authorization: 'API YOUR_API_KEY',
'Content-Type': 'application/json',
},
});
const data = await res.json();import requests
res = requests.get(
"https://api.synup.com/api/v4/gbp-categories?countryIso=&siteCategoryId=",
headers={
"Authorization": "API YOUR_API_KEY",
"Content-Type": "application/json",
},
)
data = res.json()req, _ := http.NewRequest("GET", "https://api.synup.com/api/v4/gbp-categories?countryIso=&siteCategoryId=", nil)
req.Header.Set("Authorization", "API YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Responses
| Status | Description |
|---|---|
200 | Successfully retrieved GBP categories. |
400 | Bad request. gbpCategories is null and errors[0].message says why: "countryIso is required." when countryIso is missing; "This country doesn't exist." when countryIso is not a known country; or "'gcid:not_a_category' is not a Google Business Profile category in US." when siteCategoryId is not a GBP category in that country. |
401 | Unauthorized. Invalid or missing API key (errors[0].message is "SY90005:Invalid Token"). |
500 | Internal Server Error. |
Example response
{
"data": {
"gbpCategories": {
"totalResult": 2,
"categories": [
{
"name": "Aadhaar center",
"siteCategoryId": "gcid:aadhar_center"
},
{
"name": "Bakery",
"siteCategoryId": "gcid:bakery"
}
]
}
}
}Response body
| Name | Type | Required | Description |
|---|---|---|---|
data | object | required | |
data.gbpCategories | object | required | GBP categories in the country. |
data.gbpCategories.totalResult | integer | required | Number of categories returned. |
data.gbpCategories.categories | array of object | required | One entry per Google category ID. |
data.gbpCategories.categories[].name | string | required | Category name. |
data.gbpCategories.categories[].siteCategoryId | string | required | Google category ID (GCID), e.g. gcid:bakery. Send this value as primaryGbpSiteCategoryId or in additionalGbpSiteCategoryIds. |