Get Google Business Locations
This endpoint queries the Google Business Profile API in real-time to return all available locations for a connected account. Use this to let users choose which location to post to.
Get Google Business Locations
-
Method:
GET -
Endpoint:
/api/uploadposts/google-business/locations -
Authentication:
- API Key in the
Authorizationheader.Authorization: Apikey <YOUR_API_KEY>
- API Key in the
-
Query Parameters:
| Parameter | Type | Description | Required |
|---|---|---|---|
profile | string | Optional. The profile's username. If provided, the API will return only the locations associated with the Google Business account linked to that profile. | No |
- Successful Response (
200 OK)
{
"success": true,
"locations": [
{
"name": "accounts/123456789/locations/111111111",
"title": "Main Street Store",
"account_id": "accounts_123456789_111111111"
},
{
"name": "accounts/123456789/locations/222222222",
"title": "Downtown Branch",
"account_id": "accounts_123456789_111111111"
}
]
}
| Field | Description |
|---|---|
name | The Google Business location identifier (used as gbp_location_id in uploads) |
title | Display name of the business location |
account_id | The internal Upload-Post account key |
Using Locations in Upload Requests
The gbp_location_id parameter tells the API which location to post to. First list the available locations using the endpoint above, then include the selected location's name as gbp_location_id in your upload request.
| Parameter | Type | Description | Required |
|---|---|---|---|
gbp_location_id | string | The location to post to. Must be a valid location name from the locations list. | No* |
This parameter works with all upload endpoints (/api/upload, /api/upload_photos, /api/upload_text).
Auto-select fallback: If
gbp_location_idis not provided, the API will automatically query your available locations. If your account has exactly one location, it will be used automatically. If you have multiple locations, the API returns an error asking you to select one. If you have zero locations, the API returns an error indicating no locations were found.
Example:
curl -X POST https://api.upload-post.com/api/upload_text \
-H "Authorization: Apikey YOUR_API_KEY" \
-F 'user=my-profile' \
-F 'platform[]=google_business' \
-F 'title=Hello from our Downtown Branch!' \
-F 'gbp_location_id=accounts/123456789/locations/222222222' \
-F 'gbp_topic_type=STANDARD'
Local Posts vs. the Media/Gallery Tab
A Google Business upload can target two different places on the location:
| Destination | How to select it | Result |
|---|---|---|
| Updates tab (Local Post) | Default. Nothing extra to send. | Creates a Local Post, optionally STANDARD, EVENT or OFFER. |
| Media / Gallery tab | gbp_post_type=MEDIA (also accepts PHOTO or GALLERY), or gbp_upload_to_gallery=true | Uploads the attached photo straight to the location's photo gallery. |
When targeting the Media/Gallery tab you can also send gbp_media_category (alias media_category) to file the photo under a category — COVER, PROFILE, LOGO, EXTERIOR, INTERIOR, PRODUCT, AT_WORK, FOOD_AND_DRINK, MENU, COMMON_AREA, ROOMS, TEAMS or ADDITIONAL (the default).
curl -X POST https://api.upload-post.com/api/upload_photos \
-H "Authorization: Apikey YOUR_API_KEY" \
-F 'user=my-profile' \
-F 'platform[]=google_business' \
-F 'photos[]=@/path/to/storefront.jpg' \
-F 'gbp_location_id=accounts/123456789/locations/222222222' \
-F 'gbp_post_type=MEDIA' \
-F 'gbp_media_category=EXTERIOR'
➡️ Full parameters, response shape and errors: Publishing to the Media/Gallery tab.
- Additional Notes:
- Locations are queried live from the Google Business API each time you call this endpoint.
- The endpoint handles token refresh automatically if the stored access token has expired.
- Connect your Google account via OAuth first — the connection stores your credentials, and this endpoint uses them to fetch locations in real-time.
- Works the same way as Facebook pages: connect once, then select which location to post to on each upload.