# The v2 API is deprecated

restcountries.com deprecated /v2/* without giving a shutdown date yet.

The provider deprecated the v2 API without a shutdown date. This deprecation affects all /v2/* requests, which will eventually fail. The provider stated that earlier versions were public iterations and have been deprecated in favor of v5.

## What to use instead

Migrate your calls to api.restcountries.com/countries/v5, such as /countries/v5/names.common/{name}. The move requires more than changing an address, as field names changed in v5 and you must choose an account plan to obtain an API key for the Authorization Bearer header.

v5 needs an account and an API key (free tier, paid plans above it).

- API: restcountries.com (restcountries.com)
- Kind: Version retirement
- Takes effect: no date given yet
- Calls after that day: fail
- Calls it hits: `/v2/*`
- Source: [Announcement](https://restcountries.com/docs)
- Verified: October 27, 2026, against restcountries.com's own pages
- Page: https://www.okapi.bot/providers/restcountries-com/breaking-changes/the-v2-api-is-deprecated/

## restcountries.com's words

> The Countries API is currently at v5 , the first version we consider long-term stable ; versions v1 – v4 were public iterations and have been deprecated.

Okapi finds the calls this change hits in your repo and opens the pull request with the fix: https://github.com/apps/okapi-agent
