Travel Advisories API (Extended Version)

Daily updated travel advisories with assessments for every country. Containing more details!
Last update: 2019-08-29

Quickstart

This is the more detailed (and paid) version of the Free REST API. The usage is identical to the free version. The difference is, you have to supply an apikey and the JSON reply contains a lot more details (including recent changes or individual ratings by source).

Terms of Service

(1) First of all, to use this service, you need a payed subscription or demo key (more about that later).

(2) You can do whatever you want with the data you recieve. Store it for eternity or build multiple projects. You paid for it, you can keep it. With one obvious exception: don't plain resell the data. Taking the api, rewrapping it and reselling it (or making it available for free) is not allowed. If you have derived products from the data that you sell or give away - that is totally fine. When in doubt, just ask.

(3) This api comes without warranty or uptime promises. Uptime has been > 99,97% last year. However, servers can break. So you should not use this API to operate a nuclear reactor and cache results to compensate for downtimes. If you need a very high availability: yes, we can work out something individual in that case.

(4) Though I try to put great care in the coding, official travel advisories could be misinterpreted and show a wrong scoring. So you should not base potentially life threatening decisions on the API data alone.

(5) This API is designed for light traffic. If you wish to embed this data into your application, please consider a local and/or central caching. A few clients doing a few requests per day is totally fine. If it gets more, please contact me so I can provide you with a more scalable solution. We will work out a very fair pricing depending on your individual requirements. If in doubt, just ask.

(6) Attribution. Please refer to Travel-Advisory.info as source of data when you use the api in your application/website/app. It doesn't have to be a big bright badge, but it should be in context of the data shown. A page where you list contributors would also be totally fine. If you need an absolute white label solution, let me know.

(7) Cancellation. There is no automatic subscription. So latest, after one year, the pre-paid contract ends (which you can renew of course). In case of breach of Terms of Service, your api key may be suspended without compensation for remaining time. However, before I take these measures, I'll contact you so we can work on the problem.

Again: If possible, please cache your requests. The data is only updated once per day in the morning and doesn't change till the next day. If you start/keep banging my beloved server, I have the right to cancel the contract.

Pricing, Test-Drive and how to pay

Testing/Demo:
Send me a polite e-mail (see imprint and privacy policy for contact details). Please, briefly describe how you want to use the data. Give me a day or two and I should send you an api key that is valid for two weeks. That should allow you for a good overview of what the api does for you.

Pricing:
For small and hobby websites the api costs 30 Euro / year (special offer).
For larger websites and regular commercial applications the api costs 240 EUR / year.
For highly enterprise like applications we work out something individual.

If any of your websites or apps using this API is having more than 25,000 users/month, you should get the commercial license. If your projects has more than 5m impressions per year, you fall into the enterprise category. Please note: Counting travel info impression also apply if you create widgets for other webmasters. Their views count into the allowance too. There is no functional difference between the three. Again, if in doubt, let's talk.

Payment:
Payment is usually prepaid for a year. You can pay with paypal, regular bank transfer or crypto currencies such as Bitcoin, Doge or Ethereum. You will recieve a proper invoice.

For now, this is a manual process. So if you want to get started, drop me a line via e-mail (no fancy shopping basket). I don't bite and I am flexible on conditions and requirements.

How to use

Essentially as simple as it gets.

Basic API Endpoint

https://www.travel-advisory.info/extended-api?apikey=[YOUR_KEY]

Calling this URL as GET will return all advisories for all countries we keep track of in JSON format.

This API requires connection by https.

Download sample JSON (all countries)

Optional Parameter

https://www.travel-advisory.info/extended-api?apikey=[YOUR_KEY]&countrycode=AU

Using the api together with the optional parameter 'countrycode' and a single two-letter ISO countrycode will restrict the result list to a single country.

See Wikipedia for a comprehensive list of possible codes.

Download sample JSON (Trinidad and Tobago, has history)

Download sample JSON (Mali, has local advisories)

Description of data structure

Here you see a list of the available fields, their format and meaning.

Node / Name Format Meaning
api_status Object Information about your request and the API
banner String Used for communicating things
request Object Applied filters to the api
country String Is a specific item (country) requested. Either contains a 2 Letter Iso code or the string "not specified"
error Object Information about potential error that may have happened
httpstatus Integer Equivalent to http status codes. If you don't want to analyze http headers, you can use this
httperror String Word representation of the http error code
info String A more detailled error message for humans
data Array list of objects containing single country advisory data
data[countrycode] Object Key of element is 2-letter iso country code
country_code char(2) string ISO 2 letter country code
country_name String English name of the country
continent_code char(2) string 2 letter continent code
continent_name String English name of the continent
continent_sub_name String English name of the sub continent of country
source String Name of source
source_link String URL of the source
summary Object Contains a summary of the data
score Float Current risk assessment score for the named country
sources_active Integer Number of official sources that have issues an advisory for the named country
updated Timestamp Date of the last calculation of the countries score
status String Word representation of the rating
details [ ] Array List of objects. The individual advisories we collected. No specific key to access. The number of entries can vary from 0 (empty array) to 9
source String Word representation of the issuing state/country
source_iso_alpha2 char(2) ISO 2 letter country code of the issuing state/country
source_link String URL of the individual travel advisories
score Float Current risk assessment score for the named country
coverage String What area of the country is covered by this advisory
local [ ] Array This array only exists if there are any local travel advisories by the same issuing country
... The structure is identical to the above (sources, score and coverage)
history [ ] Array List of objects. Contains dates (sorted DESC) when the risk rating has changed. Each object contains info on score change and specifically, what was changed. Please note: historic recording startet March 2019 (so no earlier info). Array is empty if no history/changes are known.
date Datestamp Date when the change has occured. In format YYYY-MM-DD.
score_total_new Float The new rating that was given to the country by travel-advisory.info
score_total_was Float The old rating that was replaced
change_details [ ] Array List containing the individual changes we recognized for this country.
source String Word representation of the issuing state/country
source_iso_alpha2 char(2) ISO 2 letter country code
score_new Integer The new rating that was issued
score_was Integer The old rating that was replaced
advisory_removed Boolean Will be "1" when the issuing country has removed the advisory
advisory_is_new Boolean Will be "1" a new advisory was issued

Example Reply for Trinidad and Tobago

		
{
  "api_status": {
    "banner": "Thank you for using Travel-Advisory.info",
    "request": {
      "country": "tt"
    }
  },
  "error": {
    "httpstatus": 200,
    "httperror": "ok",
    "info": "all good"
  },
  "data": [
    {
      "country_code": "TT",
      "country_name": "Trinidad and Tobago",
      "continent_code": "NA",
      "continent_name": "North America",
      "continent_sub_name": "Caribbean",
      "source": "Travel-Advisory.info",
      "source_link": "https://www.travel-advisory.info/trinidad-and-tobago",
      "summary": {
        "score": 2.2,
        "sources_active": 5,
        "updated": "2019-03-18 07:26:48",
        "status": "Travel with caution"
      },
      "details": [
        {
          "source": "Maltese Government",
          "source_iso_alpha2": "MT",
          "source_link": "https://foreignaffairs.gov.mt/en/Pages/Travel-Advice.aspx",
          "score": 1,
          "coverage": "National advisory"
        },
        {
          "source": "United States Government",
          "source_iso_alpha2": "US",
          "source_link": "http://travel.state.gov/content/travel/en/traveladvisories/traveladvisories/trinidad-and-tobago-travel-advisory.html",
          "score": 2,
          "coverage": "National advisory"
        },
        {
          "source": "New Zealand Government",
          "source_iso_alpha2": "NZ",
          "source_link": "https://www.safetravel.govt.nz/trinidad-and-tobago",
          "score": 2,
          "coverage": "National advisory"
        },
        {
          "source": "Canadian Government",
          "source_iso_alpha2": "CA",
          "source_link": "https://travel.gc.ca/destinations/trinidad-and-tobago",
          "score": 3,
          "coverage": "National advisory"
        },
        {
          "source": "Irish Government",
          "source_iso_alpha2": "IE",
          "source_link": "https://www.dfa.ie/travel/travel-advice/a-z-list-of-countries/trinidad-and-tobago/",
          "score": 3,
          "coverage": "National advisory"
        }
      ],
      "history": [
        {
          "date": "2019-03-07",
          "score_total_new": 2.2,
          "score_total_was": 2,
          "change_details": [
            {
              "source": "United States Government",
              "source_iso_alpha2": "US",
              "score_new": 2,
              "score_was": 1,
              "advisory_removed": 0,
              "advisory_is_new": 0
            }
          ]
        }
      ]
    }
  ]
}