> For the complete documentation index, see [llms.txt](https://fatos-doc.fatos.biz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fatos-doc.fatos.biz/fatos-api/search.md).

# Search

{% hint style="info" %}
See the [**API Key Issuance page**](/get-your-api-key.md) for information on using keys.
{% endhint %}

| Method | Request URI                           | Response Type |
| ------ | ------------------------------------- | ------------- |
| GET    | https\:/api.fatos.biz/search/v1/total | JSON          |

### Parameter

| Parameter | Required | Description                                                                                            | Sample                                              |
| --------- | -------- | ------------------------------------------------------------------------------------------------------ | --------------------------------------------------- |
| key       | Y        | Your API Key.                                                                                          | key=xxxxxxxxxxx                                     |
| kwd       | Y        | Name search: search word                                                                               | kwd=파토스                                             |
| cx        | Y        | User's current location X coordinate (wgs84) (Longitude)                                               | cx=126.896038                                       |
| cy        | Y        | User's current location Y coordinate (wgs84) (Latitude)                                                | cy=37.482901                                        |
| sx        | N        | Search Criteria Location X Coordinates (WGS84)                                                         | sx=126.896038                                       |
| sy        | N        | Search Criteria Location Y Coordinates (WGS84)                                                         | sy=37.482901                                        |
| lang      | Y        | <p>Search Language<br>Default : en</p>                                                                 | 한국어: kr, 영어: en, 태국어: th …                          |
| pno       | N        | <p>Page number<br>Default : 1</p>                                                                      | pno=1                                               |
| cpp       | N        | <p>Number of searches per page <br>Default : 20</p>                                                    | cpp=20                                              |
| sort      | N        | <p>Specifies the sort order of search results in either accuracy or distance order.<br>Default : 0</p> | <p>sort =0 // accuracy<br>sort = 1 //  distance</p> |

### Response

|    NAME    |    Type    |                           Description                          |
| :--------: | :--------: | :------------------------------------------------------------: |
|     err    |   string   |      If there is an error, write the contents of the error     |
|    stype   |     int    |      The type of search used for the search. Internal Use      |
|    sort    |     int    |         The sort type used in the search. Internal Use         |
|     pno    |     int    |                           Page number                          |
|     cpp    |     int    |                   Number of searches per page                  |
|    total   |     int    |                       Number of searches                       |
|    items   |    Array   |                           Search list                          |
|     id     |   string   |                            Search ID                           |
|     flg    |     int    |                   Type of data. Internal Use                   |
|     pid    |   string   |                 Parent ID – Not currently used.                |
|     src    |     int    |                           Source Type                          |
|    cate    |   string   |             Large classification code. Internal Use            |
|    dist    | int(meter) |                            Distance                            |
|    entx    |   double   |                Entry point X coordinates (WGs84)               |
|    enty    |   double   |                Entry point Y coordinates (WGs84)               |
|    name    |   string   |                         Expression name                        |
|    posx    |   double   |                  Center X coordinates (WGs84)                  |
|    posy    |   double   |                  Center Y coordinates (WGs84)                  |
|    addr1   |   string   |                             Address                            |
|    addr2   |   string   |                 In Korea, the road name address                |
|    cate2   |   string   |              Division code. – Not currently used.              |
|    phone   |   string   |                Phone number: delimiter comma (,)               |
|    props   |    array   |              POI Properties – Not currently used.              |
|   hassub   |     int    | Sub POI Existence (0: None, Other : Yes) – Not currently used. |
|   s\_dist  | int(meter) |                         Screen Distance                        |
|  addr\_en  |   string   |                       an English address                       |
|   entries  |    array   |        Multiple Entry Points List – Not currently used.        |
|  name\_en  |   string   |                         an English name                        |
| geom\_type |   string   |                          geometry type                         |

### Response Sample

```javascript
{
    "err": null,
    "stype": 0,
    "sort": 0,
    "pno": 1,
    "cpp": 20,
    "total": 7,
    "src_type": null,
    "data_type": 1,
    "items": [
        {
            "id": "1002511501",
            "flg": 3,
            "pid": null,
            "src": 8,
            "cate": "739999",
            "dist": 16,
            "entx": 126.89557441171448,
            "enty": 37.48279296688024,
            "name": "파토스",
            "posx": 126.89618546251323,
            "posy": 37.482820752242,
            "addr1": "서울 구로구 구로동 222-8",
            "addr2": "서울 구로구 디지털로30길 31",
            "cate2": null,
            "phone": null,
            "props": null,
            "hassub": 0,
            "s_dist": 16,
            "addr_en": "서울 구로구 구로동 222-8",
            "entries": null,
            "name_en": "파토스",
            "geom_type": "ST_Point"
        },
        ...
    ]
}
```

{% hint style="info" %}
Do note that search can take both (cx, cy) and (sx, sy) as parameters.\
\
If you are looking for search result around your current position, use (cx, cy).\
\
If you move the map and would like search result around the position where you moved map to, use (sx, sy).\
\
If you provide both (cx, cy) and (sx, sy), (sx, sy) has a higher priority.
{% endhint %}

{% hint style="danger" %}
Use of hex encoded value for "kwd" parameter has been deprecated and will not work.\
\
If you set "stype" as "3 (search nearby)", please use value from valid category list.\
\
Check references below to obtain valid search result by category, category list and category code.
{% endhint %}

## Get category list

<mark style="color:blue;">`GET`</mark> `https://api.fatos.biz/search/v1/cates`

<https://api.fatos.biz/search/v1/cates?key={YOUR\\_API\\_KEY}\\&lang=ko>

#### Query Parameters

| Name | Type   | Description                             |
| ---- | ------ | --------------------------------------- |
| key  | string | YOUR\_API\_KEY                          |
| lang | string | lang\_code (check Hint box right below) |

{% tabs %}
{% tab title="200 " %}

```javascript
[
    {
        "cate_code": "0",
        "cate_name": "기타"
    },
    {
        "cate_code": "1",
        "cate_name": "주유소"
    },
    {
        "cate_code": "10",
        "cate_name": "교통"
    },
    {
        "cate_code": "11",
        "cate_name": "쇼핑"
    },
    {
        "cate_code": "12",
        "cate_name": "숙박"
    },
    {
        "cate_code": "13",
        "cate_name": "관광/레저/문화"
    },
    {
        "cate_code": "2",
        "cate_name": "가스충전소"
    },
    {
        "cate_code": "3",
        "cate_name": "EV충전소"
    },
    {
        "cate_code": "4",
        "cate_name": "음식점"
    },
    {
        "cate_code": "5",
        "cate_name": "마트/편의점"
    },
    {
        "cate_code": "6",
        "cate_name": "주차장"
    },
    {
        "cate_code": "7",
        "cate_name": "정비소"
    },
    {
        "cate_code": "8",
        "cate_name": "은행/ATM"
    },
    {
        "cate_code": "9",
        "cate_name": "병원/약국"
    }
]
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
For "lang" parameter, you can find all language codes at\
\
&#x20;<https://api.fatos.biz/search/v1/langs?key=>{YOUR\_*API\_*&#x4B;EY}\
\
However, we currently provide services only for "ko", "th", "en"
{% endhint %}
