Skip to main content

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 Authorization header.
      • Authorization: Apikey <YOUR_API_KEY>
  • Query Parameters:

ParameterTypeDescriptionRequired
profilestringOptional. 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"
}
]
}
FieldDescription
nameThe Google Business location identifier (used as gbp_location_id in uploads)
titleDisplay name of the business location
account_idThe 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.

ParameterTypeDescriptionRequired
gbp_location_idstringThe 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_id is 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'
  • 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.