API endpoint for devices, countries, states and cities

Important: Tr.im API is in Beta

Get API endpoint for devicescountries, states and cities by following the steps below.

Get Devices

Url: /api/devices

Method: GET

Request

Empty. This request does not contain body.

Response

Parameter

Type

Description

devices

object

object contains list of all devices

 

An example request

POST /api/devices/list HTTP/1.1

x-api-key: 2a4ff74ee231de46d73f86777d20d96c

Content-Type: application/json

 

An example response

200 (Success)

ContentType: application/json

[{"id":1,"name":"Kindle Fire"},{"id":2,"name":"Kindle Reader"},{"id":3,"name":"iPad"},{"id":4,"name":"iPhone"},{"id":5,"name":"BlackBerry"},{"id":6,"name":"Windows Phone"},{"id":7,"name":"Android"},{"id":8,"name":"PC"}]

 

Get Countries

Url: /api/countries

Method: GET

Request

Empty. This request does not contain body.

 

Response 

Parameter

Type

Description

countries

object

object contains list of all countries

 

An example request

POST /api/countries/list HTTP/1.1

x-api-key: 2a4ff74ee231de46d73f86777d20d96c

Content-Type: application/json

 

An example response

200 (Success)

ContentType: application/json

[{"id":1,"name":"Andorra","code":"AD","population":84000},{"id":2,"name":"United Arab Emirates","code":"AE","population":4975593},{"id":3,"name":"Afghanistan","code":"AF","population":29121286},{"id":4,"name":"Antigua and Barbuda","code":"AG","population":86754},{"id":5,"name":"Anguilla","code":"AI","population":13254},...]

 

Get States

Url: /api/countries/<COUNTRY_CODE>/states

Method: GET

Request

Empty. This request does not contain body.

 

Response 

Parameter

Type

Description

states

object

object contains list of all states in country

 

An example request

POST /api/countries/MT/states/list HTTP/1.1

x-api-key: 2a4ff74ee231de46d73f86777d20d96c

Content-Type: application/json

 

An example response

200 (Success)

ContentType: application/json

[{"id":8299700,"name":"Attard","country_code":"MT"},{"id":8299701,"name":"Balzan","country_code":"MT"},{"id":8299702,"name":"Il-Birgu","country_code":"MT"},{"id":8299703,"name":"Birkirkara","country_code":"MT"},..]

 

Get Cities

Url: /api/countries/<COUNTRY_CODE>/cities

Method: GET

Request

Empty. This request does not contain body.

 

Response

Parameter

Type

Description

cities

object

object contains list of all cities in country

 

An example request

POST /api/countries/MT/cities/list HTTP/1.1

x-api-key: 2a4ff74ee231de46d73f86777d20d96c

Content-Type: application/json

 

An example response

200 (Success)

ContentType: application/json

[{"id":2562247,"name":"Marsaxlokk","state_name":"Marsaxlokk","country_code":"MT"},{"id":2562250,"name":"\u017burrieq","state_name":"I\u017c-\u017burrieq","country_code":"MT"},{"id":2562258,"name":"\u017bejtun","state_name":"I\u017c-\u017bejtun","country_code":"MT"},{"id":2562260,"name":"\u017bebbu\u0121","state_name":"I\u017c-\u017bebbu\u0121","country_code":"MT"},{"id":2562261,"name":"Haz-Zebbug","state_name":"\u0126a\u017c-\u017bebbu\u0121","country_code":"MT"},..]

 

Have more questions? Submit a request

Comments

Powered by Zendesk