Skip to content

A simple API for travel advisories published by the Australian DFAT Smartraveller

Notifications You must be signed in to change notification settings

kevle1/smartraveller-api

Repository files navigation

Smartraveller API

A simple API for travel advisories published by the Australian DFAT Smartraveller.

This is not an official API. Visit the Smartraveller website for the latest information.

Available at https://smartraveller.api.kevle.xyz/

Running Locally

pip install pipenv
pipenv install
pipenv run python wsgi.py

Deployment

Deploy with Vercel

Or configure a WSGI production server

Endpoints

Get an advice summary for a country. May be cached for up to 1 hour.

Query Parameters

  • country (required)

Example Response

https://smartraveller.api.kevle.xyz/advisory?country=es

{
  "country": {
    "name": "Spain",
    "alpha_2": "ES"
  },
  "advisory": "Exercise normal safety precautions",
  "level": 1,
  "page_url": "https://www.smartraveller.gov.au/destinations/europe/spain"
}

Get all available Smartraveller advisories. This is updated every 6 hours.

Example Response

{
    "last_updated": "2024-10-05T04:55:06.260067+00:00",
    "advisories": [
        {
          "country": {
            "name": "Spain",
            "alpha_2": "ES"
          },
          "advisory": "Exercise normal safety precautions",
          "level": 1,
          "page_url": "https://www.smartraveller.gov.au/destinations/europe/spain"
        },
    ]
}

Get all available Smartraveller destinations. This is updated every 6 hours.

Example Response

{
    "last_updated": "2024-10-05T04:55:06.260067+00:00",
    "destinations": {
      "ES": {
        "country": {
          "name": "Spain",
          "alpha_2": "ES"
        },
        "page_url": "/destinations/europe/spain"
      },
    }
}

Data

Smartraveller publishes advisories under non-standard names for countries and does not seem to utilise any standard country codes. Countries have been mapped using a fuzzy search for the country based on the URL slug fetched from: https://www.smartraveller.gov.au/api/publishedpages.

This method of parsing countries may produce inconsistent or inaccurate results.

If a country can't be found it may be due to a failed lookup, or an advisory not being published for that country.

Copyright

Smartraveller material is provided under the latest Creative Commons Attribution licence.

Information: https://www.smartraveller.gov.au/copyright

About

A simple API for travel advisories published by the Australian DFAT Smartraveller

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages