> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keyapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Search places

> Instagram places search endpoint, returns matching location results.

<div className="inline-flex items-center gap-2 px-4 py-2 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg">
  <span className="text-base">🪙</span>
  <span className="text-sm font-medium text-yellow-900 dark:text-yellow-100"><span className="font-semibold">2 credits</span><span className="text-yellow-700 dark:text-yellow-300 ml-1">per request</span></span>
</div>

## Copy for AI

<div className="my-6 rounded-xl border border-gray-200 bg-gray-50 p-5 dark:border-gray-800 dark:bg-gray-900/40">
  <div className="min-w-0">
    <p className="text-base font-semibold text-gray-900 dark:text-gray-100">🤖 Why Code When AI Can Do It For You?</p>
    <p className="mt-1 text-sm text-gray-700 dark:text-gray-300">Stop writing code like it's 1970! Let AI do the heavy lifting - click the sparkles to copy a perfectly formatted prompt for ChatGPT, Claude, or your favorite AI assistant.</p>
  </div>

  <div className="mt-4">
    <button
      type="button"
      className="inline-flex items-center gap-2 rounded-md border border-emerald-300 bg-emerald-50 px-3 py-2 text-sm font-medium text-emerald-800 hover:bg-emerald-100 dark:border-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-100 dark:hover:bg-emerald-900/50"
      onClick={() => navigator.clipboard.writeText(`I want to make an API call to https://api.keyapi.ai/v1/instagram/search_places.

Please help me write code to make this API call and handle the response appropriately. Include error handling and best practices.

Here are the details:

Endpoint: GET https://api.keyapi.ai/v1/instagram/search_places

Description: Instagram places search endpoint, returns matching location results.

Required Headers:
--header 'Authorization: Bearer <YOUR_API_KEY>'

Parameters:
- query (Required): Search keyword. Example: tokyo

Example Response:
{
"code": 0,
"message": "success",
"data": {
"places": [
  {
    "position": 0,
    "place": {
      "location": {
        "pk": "152072408969152",
        "name": "Tokyo",
        "facebook_places_id": "152072408969152"
      },
      "subtitle": "",
      "title": "Tokyo"
    }
  },
  {
    "position": 1,
    "place": {
      "location": {
        "pk": "133807127334141",
        "name": "Tokyo",
        "facebook_places_id": "133807127334141"
      },
      "subtitle": "",
      "title": "Tokyo"
    }
  },
  {
    "position": 2,
    "place": {
      "location": {
        "pk": "100847574753640",
        "name": "Tokyo, Japan",
        "facebook_places_id": "100847574753640"
      },
      "subtitle": "",
      "title": "Tokyo, Japan"
    }
  },
  {
    "position": 3,
    "place": {
      "location": {
        "pk": "104373574421310",
        "name": "Tokyo Japan",
        "facebook_places_id": "104373574421310"
      },
      "subtitle": "",
      "title": "Tokyo Japan"
    }
  },
  {
    "position": 4,
    "place": {
      "location": {
        "pk": "159544210920268",
        "name": "Tokyo, Japan",
        "facebook_places_id": "159544210920268"
      },
      "subtitle": "",
      "title": "Tokyo, Japan"
    }
  },
  {

... (truncated)`)}
    >
      <span>✨</span>
      <span>Copy for AI</span>
    </button>
  </div>
</div>


## OpenAPI

````yaml en/instagram.openapi.json GET /v1/instagram/search_places
openapi: 3.0.1
info:
  title: Instagram API english documentation
  description: >-
    The english reference documentation of the Instagram API includes the
    interface's purpose, parameter description, response status, and sample
    structure.
  version: 1.0.0
servers:
  - url: https://api.keyapi.ai
    description: Production
security:
  - JWT Bearer: []
tags: []
paths:
  /v1/instagram/search_places:
    get:
      tags: []
      summary: Search places
      description: Instagram places search endpoint, returns matching location results.
      parameters:
        - name: query
          in: query
          description: Search keyword
          required: true
          example: tokyo
          schema:
            type: string
            example: tokyo
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example:
                code: 0
                message: success
                data:
                  places:
                    - position: 0
                      place:
                        location:
                          pk: '152072408969152'
                          name: Tokyo
                          facebook_places_id: '152072408969152'
                        subtitle: ''
                        title: Tokyo
                    - position: 1
                      place:
                        location:
                          pk: '133807127334141'
                          name: Tokyo
                          facebook_places_id: '133807127334141'
                        subtitle: ''
                        title: Tokyo
                    - position: 2
                      place:
                        location:
                          pk: '100847574753640'
                          name: Tokyo, Japan
                          facebook_places_id: '100847574753640'
                        subtitle: ''
                        title: Tokyo, Japan
                    - position: 3
                      place:
                        location:
                          pk: '104373574421310'
                          name: Tokyo Japan
                          facebook_places_id: '104373574421310'
                        subtitle: ''
                        title: Tokyo Japan
                    - position: 4
                      place:
                        location:
                          pk: '159544210920268'
                          name: Tokyo, Japan
                          facebook_places_id: '159544210920268'
                        subtitle: ''
                        title: Tokyo, Japan
                    - position: 5
                      place:
                        location:
                          pk: '684905081958150'
                          name: Tokyo
                          facebook_places_id: '684905081958150'
                        subtitle: ''
                        title: Tokyo
                    - position: 6
                      place:
                        location:
                          pk: '212984894'
                          name: 涩谷区
                          facebook_places_id: '114600441890814'
                        subtitle: ''
                        title: Shibuya, Tokyo
                    - position: 7
                      place:
                        location:
                          pk: '734884166'
                          name: Tokyo,japan
                          facebook_places_id: '394922200612073'
                        subtitle: ''
                        title: Tokyo,japan
                    - position: 8
                      place:
                        location:
                          pk: '403635869761822'
                          name: Tokyo, Japan
                          facebook_places_id: '403635869761822'
                        subtitle: ''
                        title: Tokyo, Japan
                    - position: 9
                      place:
                        location:
                          pk: '212948257'
                          name: Tokyo Disneyland
                          facebook_places_id: '105646212803457'
                        subtitle: ''
                        title: Tokyo Disneyland
                    - position: 10
                      place:
                        location:
                          pk: '225841010'
                          name: Tokyo DisneySea
                          facebook_places_id: '109986675693859'
                        subtitle: ''
                        title: Tokyo DisneySea
                    - position: 11
                      place:
                        location:
                          pk: '268968617'
                          name: Tokyo 東京, Japan
                          facebook_places_id: '112322702197089'
                        subtitle: ''
                        title: Tokyo 東京, Japan
                    - position: 12
                      place:
                        location:
                          pk: '328601145'
                          name: Tokyo Tower
                          facebook_places_id: '104135836288581'
                        subtitle: ''
                        title: Tokyo Tower
                    - position: 13
                      place:
                        location:
                          pk: '378264559'
                          name: Tokyo Dome
                          facebook_places_id: '107924339228173'
                        subtitle: ''
                        title: Tokyo Dome
                    - position: 14
                      place:
                        location:
                          pk: '259773994'
                          name: Tokyo Disney Land
                          facebook_places_id: '159033634166129'
                        subtitle: ''
                        title: Tokyo Disney Land
                    - position: 15
                      place:
                        location:
                          pk: '114082609970762'
                          name: Tokyo
                          facebook_places_id: '114082609970762'
                        subtitle: ''
                        title: Tokyo
                    - position: 16
                      place:
                        location:
                          pk: '254478873'
                          name: Tokyo Skytree
                          facebook_places_id: '405491696176944'
                        subtitle: ''
                        title: Tokyo Skytree
                    - position: 17
                      place:
                        location:
                          pk: '1379213942099658'
                          name: 東京 Tokyo
                          facebook_places_id: '1379213942099658'
                        subtitle: ''
                        title: 東京 Tokyo
                    - position: 18
                      place:
                        location:
                          pk: '241285726'
                          name: 世田谷区
                          facebook_places_id: '112344735447930'
                        subtitle: ''
                        title: Setagaya, Tokyo
                    - position: 19
                      place:
                        location:
                          pk: '112010748814588'
                          name: Tokyo Bay
                          facebook_places_id: '112010748814588'
                        subtitle: Tokyo Japan
                        title: Tokyo Bay
                    - position: 20
                      place:
                        location:
                          pk: '638582756258707'
                          name: 东京都
                          facebook_places_id: '638582756258707'
                        subtitle: ''
                        title: Đông Kinh (Nhật)
                    - position: 21
                      place:
                        location:
                          pk: '249603568'
                          name: 八王子市
                          facebook_places_id: '110671395624688'
                        subtitle: ''
                        title: Hachioji, Tokyo
                    - position: 22
                      place:
                        location:
                          pk: '103535502'
                          name: Tokyo Big Sight
                          facebook_places_id: '103263756396156'
                        subtitle: ''
                        title: Tokyo Big Sight
                    - position: 23
                      place:
                        location:
                          pk: '213036120'
                          name: Tokyo Imperial Palace
                          facebook_places_id: '107016779335099'
                        subtitle: ''
                        title: Tokyo Imperial Palace
                    - position: 24
                      place:
                        location:
                          pk: '463872380673542'
                          name: Tokyo 東 京
                          facebook_places_id: '463872380673542'
                        subtitle: Rua Major Sertório, 110
                        title: Tokyo 東 京
                    - position: 25
                      place:
                        location:
                          pk: '384207572'
                          name: Tokyo Station
                          facebook_places_id: '111248308896564'
                        subtitle: ''
                        title: Tokyo Station
                    - position: 26
                      place:
                        location:
                          pk: '458362054737480'
                          name: Tokyo, Japan
                          facebook_places_id: '458362054737480'
                        subtitle: ''
                        title: Tokyo, Japan
                    - position: 27
                      place:
                        location:
                          pk: '234915980'
                          name: 町田市
                          facebook_places_id: '105733206128254'
                        subtitle: ''
                        title: Machida, Tokyo
                    - position: 28
                      place:
                        location:
                          pk: '252455502'
                          name: Shinjuku Tokyo Japan
                          facebook_places_id: '365986813467338'
                        subtitle: ''
                        title: Shinjuku Tokyo Japan
                    - position: 29
                      place:
                        location:
                          pk: '214737819'
                          name: Harajuku, Tokyo（原宿）
                          facebook_places_id: '129220367133483'
                        subtitle: ''
                        title: Harajuku, Tokyo（原宿）
                    - position: 30
                      place:
                        location:
                          pk: '105905148754107'
                          name: Ginza Tokyo
                          facebook_places_id: '105905148754107'
                        subtitle: 東京都中央区銀座8-7-9金六ビル3階
                        title: Ginza Tokyo
                    - position: 31
                      place:
                        location:
                          pk: '766248427122938'
                          name: Tokyo Olympic Stadium
                          facebook_places_id: '766248427122938'
                        subtitle: 10-2, Kasumigaoka-machi, Shinjuku, Tokyo, Japan
                        title: Tokyo Olympic Stadium
                    - position: 32
                      place:
                        location:
                          pk: '238311983'
                          name: 练马区
                          facebook_places_id: '108256259196005'
                        subtitle: ''
                        title: Nerima, Tokyo
                    - position: 33
                      place:
                        location:
                          pk: '325449585'
                          name: 丰岛区
                          facebook_places_id: '108027062558523'
                        subtitle: ''
                        title: Toshima, Tokyo
                    - position: 34
                      place:
                        location:
                          pk: '214920958'
                          name: Ginza, Tokyo, Japan
                          facebook_places_id: '104666836238570'
                        subtitle: ''
                        title: Ginza, Tokyo, Japan
                    - position: 35
                      place:
                        location:
                          pk: '11038189'
                          name: Tokyo Disneyland Hotel
                          facebook_places_id: '140657362627465'
                        subtitle: ''
                        title: Tokyo Disneyland Hotel
                    - position: 36
                      place:
                        location:
                          pk: '1739341636128241'
                          name: teamLab Planets TOKYO / チームラボプラネッツ
                          facebook_places_id: '1739341636128241'
                        subtitle: 東京都江東区豊洲6-1-16,Toyosu
                        title: teamLab Planets TOKYO / チームラボプラネッツ
                    - position: 37
                      place:
                        location:
                          pk: '235541246'
                          name: 墨田区
                          facebook_places_id: '105673259466695'
                        subtitle: ''
                        title: Sumida, Tokyo
                    - position: 38
                      place:
                        location:
                          pk: '232436753970280'
                          name: Tokyo Shibuya Crossing
                          facebook_places_id: '232436753970280'
                        subtitle: 2 Chome-24-1 Shibuya
                        title: Tokyo Shibuya Crossing
                    - position: 39
                      place:
                        location:
                          pk: '525503'
                          name: 東京スカイツリー / Tokyo Skytree
                          facebook_places_id: '149655571740038'
                        subtitle: 1-1-2 Oshiage
                        title: 東京スカイツリー / Tokyo Skytree
                    - position: 40
                      place:
                        location:
                          pk: '214227216'
                          name: Ota-ku, Tokyo, Japan
                          facebook_places_id: '121336244603804'
                        subtitle: ''
                        title: Ota-ku, Tokyo, Japan
                    - position: 41
                      place:
                        location:
                          pk: '235312288'
                          name: Minato-ku, Tokyo, Japan
                          facebook_places_id: '160300197351040'
                        subtitle: ''
                        title: Minato-ku, Tokyo, Japan
                    - position: 42
                      place:
                        location:
                          pk: '2275431292682060'
                          name: Japao-Tokyo
                          facebook_places_id: '2275431292682060'
                        subtitle: ''
                        title: Japao-Tokyo
                    - position: 43
                      place:
                        location:
                          pk: '242896806'
                          name: Akasaka, Tokyo
                          facebook_places_id: '106800382691386'
                        subtitle: ''
                        title: Akasaka, Tokyo
                    - position: 44
                      place:
                        location:
                          pk: '228430811024902'
                          name: Tokyo-Narita International Airport
                          facebook_places_id: '228430811024902'
                        subtitle: ''
                        title: Tokyo-Narita International Airport
                    - position: 45
                      place:
                        location:
                          pk: '382633415'
                          name: Tokyo Dome City
                          facebook_places_id: '134819496551726'
                        subtitle: ''
                        title: Tokyo Dome City
                    - position: 46
                      place:
                        location:
                          pk: '239746532'
                          name: Shinagawa-ku, Tokyo, Japan
                          facebook_places_id: '159738940740201'
                        subtitle: ''
                        title: Shinagawa-ku, Tokyo, Japan
                    - position: 47
                      place:
                        location:
                          pk: '440543021'
                          name: 港区 (东京都)
                          facebook_places_id: '109375782415507'
                        subtitle: ''
                        title: Minato, Tokyo
                    - position: 48
                      place:
                        location:
                          pk: '222502193'
                          name: 立川市
                          facebook_places_id: '108212485874332'
                        subtitle: ''
                        title: Tachikawa, Tokyo
                    - position: 49
                      place:
                        location:
                          pk: '363740814'
                          name: 府中市
                          facebook_places_id: '110378492324625'
                        subtitle: ''
                        title: Fuchu, Tokyo
                    - position: 50
                      place:
                        location:
                          pk: '131354103647215'
                          name: Tokyo Station
                          facebook_places_id: '131354103647215'
                        subtitle: 東京都千代田区丸の内一丁目, Chofu, Tokyo
                        title: Tokyo Station
                    - position: 51
                      place:
                        location:
                          pk: '1695801'
                          name: Palais de Tokyo
                          facebook_places_id: '22646294349'
                        subtitle: 13 avenue du Président Wilson
                        title: Palais de Tokyo
                    - position: 52
                      place:
                        location:
                          pk: '269712951'
                          name: Edogawa-ku, Tokyo, Japan
                          facebook_places_id: '167156293320852'
                        subtitle: ''
                        title: Edogawa-ku, Tokyo, Japan
                    - position: 53
                      place:
                        location:
                          pk: '292006687'
                          name: Odaiba Tokyo, Japan
                          facebook_places_id: '220680181427625'
                        subtitle: ''
                        title: Odaiba Tokyo, Japan
                    - position: 54
                      place:
                        location:
                          pk: '289563482'
                          name: Tokyo Disney Sea 東京海洋迪士尼
                          facebook_places_id: '225031607705830'
                        subtitle: ''
                        title: Tokyo Disney Sea 東京海洋迪士尼
                  rank_token: >-
                    1773124397940|dbd284397adce53b6e8e21d11891be7d3e6f06abffa4d285cffade4b9a5bc6cf
                  see_more: null
                  inform_module: null
                requestId: cd1875d8-ae33-4c54-9606-504d1d913af4
          headers: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 400
                  data: null
                  message: 'Missing required parameter: handle'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 401
                  data: null
                  message: apiKey is null
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 402
                  data: null
                  message: apiKey quota is not enough
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 429
                  data: null
                  message: qps limit exceeded
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 500
                  data: null
                  message: Internal server error
      deprecated: false
      security:
        - JWT Bearer: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.keyapi.ai/v1/instagram/search_places?query=tokyo' \
              --header 'Authorization: Bearer <YOUR_API_KEY>'
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.get(
                'https://api.keyapi.ai/v1/instagram/search_places',
                params={"query": "tokyo"},
                headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
            )
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >-
            const params = new URLSearchParams({"query": "tokyo"});


            const response = await
            fetch(`https://api.keyapi.ai/v1/instagram/search_places?${params}`,
            {
              method: 'GET',
              headers: { 'Authorization': 'Bearer <YOUR_API_KEY>' }
            });

            const data = await response.json();

            console.log(data);
components:
  securitySchemes:
    JWT Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |-
        API key for authentication. Format: `sk_live_xxxxxxxxxxxxx`
        Get your API key from the [Dashboard](http://keyapi.ai/app/dashboard).

````