REST Countries

DocsAPI versions

If you got here because a v1–v4 request just stopped working, start at /docs/legacy-api-deprecation. This page is the architectural background: why v1–v4 can't be kept stable, what /v5's long-term stable promise means, and how future deprecations will be communicated.

Where each version stands

/v5 Maintained
Long-term stable. Stays live indefinitely, even after future major versions ship.
/v4 Deprecated
Returns a JSON:API spec formatted response, with an errors array.
/v3 Deprecated
Returns a JSON:API spec formatted response, with an errors array.
/v2 Deprecated
Returns a JSON:API spec formatted response, with an errors array.
/v1 Deprecated
Returns a JSON:API spec formatted response, with an errors array.

Why v1–v4 can't be kept stable

The previous 4 versions of REST Countries shipped without three fundamental elements required for the long-term stability of an API. They included:

These have all been resolved with /v5, however it's required us to end support for those API versions.

What's different about v5

/v5 is committed to staying live indefintely. This is because the three fundamental issues above have been resolved:

If you have any questions about these changes. please reach out. We'll response within 24 hours.

Migrating from v1–v4 to v5

Three steps:

  1. Create an account if you don't already have one. The free tier covers 500 requests /mo with no credit card.
  2. Read the v5 docs. Every endpoint and field is documented, including the aggregates, the response_fields response-shape allowlist, the q free-text search, and the per-property filters that v1–v4 didn't support.
  3. Update your client to call /v5 with Authorization: Bearer YOUR_KEY in the request header. The bare Authorization: YOUR_KEY form (no Bearer prefix) is also accepted.

Questions

The FAQ covers the common ones. For anything tied to your specific migration, reach out via support.