Prices for any of 8000 cities around the globe in machine friendly format. In case you have any questions or suggestions please let me know via hi@traveltables.com
API is secured by API keys. You need to add your API key to each request ?apikey=<API_KEY>
parameter to get access to the data.
There are currently following endpoints available.
http://api.traveltables.com/cities
- Get JSON list of all cities available.
Please note that there is no pagination and you will get all the cities list which is around ~ 903 Kb so you may wish to save or cache it.
This list is updated very rarely on our side.
Example of the request:
curl 'http://api.traveltables.com/cities&apikey=<API_KEY>'
Response:
"cities": [
{
"city_id": 1,
"city_name": "Herat",
"country_name": "Afghanistan",
"lat": 34.352865,
"lng": 62.204028
},
...
http://api.traveltables.com/countries
- Get JSON list of all countries available.
Example of the request:
curl 'http://api.traveltables.com/countries&apikey=<API_KEY>'
Response:
"countries": [
{
"country_name": "Afghanistan",
"currency_code": "AFN",
"currency_name": "Afghan afghani"
},
{
"country_name": "Aland Islands",
"currency_code": "EUR",
"currency_name": "Euro"
},
{
"country_name": "Albania",
"currency_code": "ALL",
"currency_name": "Albanian lek"
},
{
"country_name": "Algeria",
"currency_code": "DZD",
"currency_name": "Algerian dinar"
},
...
]
http://api.traveltables.com/prices
- Get all the prices for given city.
City can be queried by name or by id. See /cities
endpoint for the corresponding ids.
Request by specifying city and country name:
curl 'http://api.traveltables.com/prices?city_name=kharkiv&country_name=ukraine&apikey=<API_KEY>'
Request by city_id:
curl 'http://api.traveltables.com/prices?city_id=2127&apikey=<API_KEY>'
Response:
{
"city_id": 2127,
"city_name": "Kharkiv",
"country_name": "Ukraine",
"prices": [
{
"good_id": 1,
"item_name": "Price per square meter to Buy Apartment Outside of City Center",
"category_id": 1,
"category_name": "Buy Apartment",
"min": 11438.63,
"avg": 15403.19,
"max": 21463.59,
"measure": "money",
"currency_code": "UAH"
},
{
"good_id": 2,
"item_name": "Price per square meter to Buy Apartment in City Center",
"category_id": 1,
"category_name": "Buy Apartment",
"min": 19064.47,
"avg": 26235.27,
"max": 40244.09,
"measure": "money",
"currency_code": "UAH"
},
{
"good_id": 3,
"item_name": "International Primary School, Yearly for 1 Child",
"category_id": 2,
"category_name": "Childcare",
"min": 17158.21,
"avg": 40631.3,
"max": 91509.84,
"measure": "money",
"currency_code": "UAH"
},
{
"good_id": 4,
"item_name": "Private Preschool or Kindergarten, Monthly for 1 Child",
"category_id": 2,
"category_name": "Childcare",
"min": 1906.53,
"avg": 5999.8,
"max": 10093.07,
"measure": "money",
"currency_code": "UAH"
},
{
"good_id": 5,
"item_name": "Pair of Jeans in a Chain Store Like George, H&M, Zara, etc.",
"category_id": 3,
"category_name": "Clothing And Shoes",
"min": 762.61,
"avg": 1555.52,
"max": 2859.79,
"measure": "money",
"currency_code": "UAH"
},
{
"good_id": 6,
"item_name": "Pair of Leather Business Shoes",
"category_id": 3,
"category_name": "Clothing And Shoes",
"min": 1429.76,
"avg": 2638.03,
"max": 4766.05,
"measure": "money",
"currency_code": "UAH"
},
{
"good_id": 7,
"item_name": "Pair of Running Shoes, Mid-Range Price",
"category_id": 3,
"category_name": "Clothing And Shoes",
"min": 1429.76,
"avg": 2240.1,
"max": 3336.29,
"measure": "money",
"currency_code": "UAH"
},
...
Request by country name:
curl 'http://api.traveltables.com/prices?country_name=Canada&apikey=<API_KEY>'
Request by country_id:
curl 'http://api.traveltables.com/prices?country_id=171&apikey=<API_KEY>'
To calculate total cost of living in a city for two person with average consumption for one month TravelTables uses empirically picked bucket of goods and services which is used as a base to calculate actual monetary amount which is representing cost of living in a given city.
Final number is calculated by multiplying goods quantity by their price and adding them together.
Users are able to see how the final number is calculated and can adjust numbers to meet their consumption style better if needed. Average bucket of goods and services for 2 person with average consumption:
+--+------------------------------------------------------------+--------+
|ID| Good title |Quantity|
+--+------------------------------------------------------------+--------+
|5 | Pair of Jeans in a Chain Store Like George, H&M, Zara, etc.| 1 |
|6 | Pair of Leather Business Shoes | 1 |
|7 | Pair of Running Shoes, Mid-Range Price | 1 |
|9 | Apples, 1 kg | 5 |
|10| Banana, 1 kg | 5 |
|11| Beef Round or Equivalent Back Leg Red Meat, 1 kg | 3 |
|12| Bottle of Wine, Mid-Range Price | 1 |
|13| Chicken Breasts, Boneless and Skinless, 1 kg | 5 |
|14| Domestic Beer, 0.5 liter Bottle | 4 |
|15| Eggs, 12 pack | 8 |
+--+------------------------------------------------------------+--------+
All the goods not mentioned in the table have a default quantity value of 0 and does not take part in calculations.
Except for Private Preschool or Kindergarten, Monthly for 1 Child
and Pack of Cigarettes
which have a default value of 0,
but can take part in calculations if user will interact with estimator controls.
Good quantity used for the different number of people is calculated based on this formula:
GoodQuantity = goodsInitialQuantity + (0.2 * goodsInitialQuantity * (NumberOfPeople - 2)))
Children number change only change the number of good Private Preschool or Kindergarten, Monthly for 1 Child
with id 4
by 1 for each child.
Changing number of smoking people change number of good Pack of Cigarettes
with id 23
by 30 for each smoking person.
Changing number of people consuming alcohol changes number of following goods:
+--+---------------------------------+---------+
|ID| Good title | Quantity|
+--+---------------------------------+---------+
|12| Bottle of Wine, Mid-Range Price | 1 |
|14| Domestic Beer, 0.5 liter Bottle | 4 |
|34| Domestic Beer, 0.5 liter Draught| 7 |
|35| Imported Beer, 0.33 liter Bottle| 1 |
+--+---------------------------------+---------+
by using this formula:
GoodQuantity = goodsInitialQuantity + (0.2 * goodsInitialQuantity * (NumberOfPeople - 2)))
npm run start