Google Business attributes and categories
Attributes are the yes/no and multiple-choice facts on a listing (Wi-Fi, outdoor seating, wheelchair access, accepted payments, …). Categories say what kind of business it is. Both are served by Google’s Business Information API. Every call is one metered Google call, and all need a package that includes the connector. Attributes are passed through in Google’s own shape (it differs by category and country), so MauKirim does not rename their fields.
GET /gmb/locations/{id}/attributes
Section titled “GET /gmb/locations/{id}/attributes”| Scope | read or gmb |
curl https://app.maukirim.com/api/v1/gmb/locations/gml_8f3kq2x1ab/attributes -H "Authorization: Bearer mk_live_…"{ "ok": true, "attributes": [ { "name": "attributes/has_wifi", "valueType": "BOOL", "values": [true] } ] }GET /gmb/locations/{id}/attributes/available
Section titled “GET /gmb/locations/{id}/attributes/available”Which attributes Google lets this business set: their names, value types and allowed values. Read this before you change attributes so the names and values are valid.
| Scope | read or gmb |
| Query | pageToken from the previous page. A page holds up to 200 entries |
{ "ok": true, "attributeMetadata": [ { "parent": "has_wifi", "valueType": "BOOL", "displayName": "Wi-Fi" } ], "nextPageToken": null}The shape of each entry is Google’s. Use the attribute’s resource name (attributes/…) in the update below.
PATCH /gmb/locations/{id}/attributes
Section titled “PATCH /gmb/locations/{id}/attributes”Sets attributes on the public listing. Only the attributes you name change.
| Scope | gmb |
| Body | { "attributes": [ { "name": "attributes/has_wifi", "values": [true] } ] } |
| Rule | Detail |
|---|---|
attributes |
1–100 objects |
name |
Required, up to 200 characters, must look like attributes/has_wifi (attributes/ then letters, digits, _ . -) |
| the rest of each object | Google’s value fields (values, uriValues, repeatedEnumValue, …), passed through. Google rejects an invalid value for the attribute with 400 invalid_input |
curl -X PATCH https://app.maukirim.com/api/v1/gmb/locations/gml_8f3kq2x1ab/attributes \ -H "Authorization: Bearer mk_live_…" -H "Content-Type: application/json" \ -d '{ "attributes": [ { "name": "attributes/has_outdoor_seating", "values": [true] } ] }'const response = await fetch(`https://app.maukirim.com/api/v1/gmb/locations/${id}/attributes`, { method: "PATCH", headers: { Authorization: `Bearer ${process.env.MAUKIRIM_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ attributes: [{ name: "attributes/has_outdoor_seating", values: [true] }] }),})const { attributes } = await response.json()$curl = curl_init("https://app.maukirim.com/api/v1/gmb/locations/$id/attributes");curl_setopt_array($curl, [ CURLOPT_CUSTOMREQUEST => 'PATCH', CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('MAUKIRIM_KEY'), 'Content-Type: application/json'], CURLOPT_POSTFIELDS => json_encode(['attributes' => [['name' => 'attributes/has_outdoor_seating', 'values' => [true]]]]), CURLOPT_RETURNTRANSFER => true,]);$attributes = json_decode(curl_exec($curl), true)['attributes'];The answer is { "ok": true, "attributes": [ … ] }: the business’s attributes as Google now has them. Repeating
the same body gives the same result, so this endpoint takes no Idempotency-Key.
GET /gmb/locations/{id}/categories
Section titled “GET /gmb/locations/{id}/categories”Searches Google’s category list so you can pick a valid category for
PATCH /gmb/locations/{id}.
| Scope | read or gmb |
| Query param | Required | Rule |
|---|---|---|
q |
yes | Part of the category’s name; 2–100 characters. Missing or too short is 400 invalid_input |
regionCode |
no | Two letters; default ID |
languageCode |
no | Default en |
curl "https://app.maukirim.com/api/v1/gmb/locations/gml_8f3kq2x1ab/categories?q=coffee®ionCode=ID" \ -H "Authorization: Bearer mk_live_…"{ "ok": true, "categories": [ { "id": "categories/gcid:coffee_shop", "name": "Coffee shop" } ] }id is the resource name to put in categories when you update the business; name is for display. At most
the first 50 matches are returned: narrow q to find a specific one.
To change a business’s categories send the resource names in
PATCH /gmb/locations/{id}: "categories": ["categories/gcid:coffee_shop", "categories/gcid:cafe"] (1–10, the first is the primary category).
Errors
Section titled “Errors”| HTTP | Code | Condition |
|---|---|---|
| 400 | invalid_input |
A malformed attribute body (not 1–100 objects, a name that does not look like attributes/…); a missing or too short q; or Google rejected the value |
| 401 | api_key_invalid / api_key_revoked / api_key_expired |
|
| 402 | gmb_plan_required |
The package does not include the connector |
| 403 | api_key_scope_denied |
Writes need gmb; reads need read or gmb |
| 403 | gmb_forbidden |
Google says the connected account may not read or change this business |
| 404 | gmb_location_not_found |
Not your business, no such business, or it left Google |
| 409 | gmb_reconnect_required / gmb_location_disabled |
See Errors |
| 429 | gmb_rate_limited |
No budget now (Retry-After) |
| 502 | gmb_upstream_error |
Google failed |
| 503 | gmb_api_unavailable |
The Business Profile API is not enabled or approved for the deployment’s Google project |