CBT Thailand Data API

GetDataCommunity



Description


      This service allows you to search any community place names in CBT. You can query specified area by sending a parameter "provinceName".


Request Header

Header

Description

Content-Type

application/json, text/json

Method

GET

Authorization

Bearer {Your CBT API key}

Accept-Language

Display language support: "th" or "en"


Parameter

Name

Type

Required

Description

keyword

String

Require*

A term to be matched with community place name.

geolocation

String

Require*

A GIS location of latitude and longitude in decimal degree. Latitude is between -90 to 90 and longitude is between -180 and 180. For example: "13.7222793,100.528923".

provinceName

String

Require*

Refer to province name in Thailand.

radius

Int

Optional

Define the distance (in meter) within latitude (Lat) and longitude (Lon) parameter. Default value is "100,000" meters and maximum value is "200,000" meters.

numberOfResult

Int

Optional

Number of record to return per/page. Default value is "20" and Maximum value is "100".

pageNumber

Int

Optional

Number of Page. Default value is "1".

filterByUpdateDate

String

Optional

Filter by updated date of value the POI. Matching regular expression pattern: For example: "2020/01/01-2020/09/30".


*Required parameters must be assigned at least one value.


Status Codes

Status Codes

Description

200 OK

Request successful

400 Bad Request

Problem with the request

401 Unauthorized

Valid API Key is not specified

403 Forbidden

Not authorized to access the resource

404 Not Found

No result found for the query

405 Method Not Allowed

A request method is not supported for the requested resource

500 Internal Server Error

Error on the internal server


Response Body

Name

Type

Description

page

-

result

-


API Reference

Input


Output


Sample

https://cbtthailand.dasta.or.th/CBTAPI/Community/GetCommunity?geolocation=13,100&radius=100000&numberOfResult=20&pageNumber=1&filterByUpdateDate=2020/01/01-2020/10/31&keyword=ชุมชน

https://cbtthailand.dasta.or.th/CBTAPI/Community/GetCommunity?numberOfResult=20&pageNumber=1&filterByUpdateDate=2020/01/01-2020/10/31&keyword=ชุมชน

https://cbtthailand.dasta.or.th/CBTAPI/Community/GetCommunity?numberOfResult=20&pageNumber=1&filterByUpdateDate=2020/01/01-2020/10/31&provinceName=กระบี่