---
title: "Search taggable locations (Instagram or Threads)"
method: GET
path: "/locations/search"
tags: ["Locations"]
---

# Search taggable locations (Instagram or Threads)

`GET /locations/search`

Search physical places to get a valid `location_id` for tagging a post. The `platform` query parameter selects the source, and the two sources use DIFFERENT ids (a Facebook Place ID is not a Threads location id), so always search with the platform you will tag.

**`platform=instagram` (default):** search by name (`q`). Returns only real venues with a precise address (the kind Instagram accepts); national brand pages, personal profiles, and Instagram location IDs are not returned because Instagram rejects them. Pass a returned `id` as the top-level `location_id` on `POST /posts/create`. Requires a Facebook account connected to the workspace (the lookup runs through Facebook's place data). Response shape: `{ data: [...], error, needsPermission }`.

**`platform=threads`:** search by name (`q`) OR by coordinates (`latitude` + `longitude`). Pass a returned `id` as `threads.location_id` on `POST /posts/create` / `PATCH /posts/{id}`. Requires a Threads account connected with the `threads_location_tagging` permission (connections made before that permission was added must be reconnected; the response then carries `error.code = threads_reauth_required`). Threads allows 500 location searches per account per rolling 24 hours. Response shape: `{ locations: [...] }` or `{ error: { code, message } }`.

## Query parameters

- `platform` 'instagram' | 'threads'
- `q` string
- `latitude` number
- `longitude` number

## Response `200`

Matching places. The shape depends on `platform`.

- union
  - object
    - `data` object[]
      - `id` string — Use this as `location_id`
      - `name` string
      - `address` string, nullable
      - `city` string, nullable
      - `country` string, nullable
    - `error` string, nullable — Set when search is unavailable (e.g. no Facebook account connected, or the app lacks place-search permission). data is then empty.
    - `needsPermission` boolean — true when the Facebook app lacks 'Page Public Content Access'.
  - object
    - `locations` object[]
      - `id` string — Use this as `threads.location_id`
      - `name` string, nullable
      - `address` string, nullable
      - `city` string, nullable
      - `country` string, nullable
      - `latitude` number, nullable
      - `longitude` number, nullable
    - `error` object, nullable — Present instead of `locations` when the search could not run.
      - `code` 'not_available' | 'threads_not_connected' | 'threads_reauth_required' | 'platform_error' — `not_available` = Threads location tagging is not enabled in this environment yet. `threads_not_connected` = no Threads account on the workspace. `threads_reauth_required` = the Threads connection lacks the `threads_location_tagging` permission; reconnect Threads. `platform_error` = Threads did not answer; retry.
      - `message` string

## Other responses

- `400` — Bad request (Threads only): neither `q` nor `latitude`+`longitude` given, `q` under 2 characters, coordinates out of range, or Threads rejected the search text.

---

[API](https://skmtc.dev/omnisocials/apis/omnisocials-api.md) · [All operations](https://skmtc.dev/omnisocials/apis/omnisocials-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/omnisocials/omnisocials-api/revisions/e53b89af0b98/schema)
