CountryPuff

Curl Examples

Copy, paste, swap the country code.

Replace US with any ISO alpha-2 (US), ISO alpha-3 (USA), GEC code (us), or country name.

Plain-text endpoints (/curl/v1/...)

Search countries by name.

curl "http://www.countrypuff.org/curl/v1/countries/search?q=united"

Full country data. country_code accepts ISO alpha-2 (US), ISO alpha-3 (USA), GEC code (us), or country name.

curl "http://www.countrypuff.org/curl/v1/country/US"

Short country summary.

curl "http://www.countrypuff.org/curl/v1/country/US/summary"

Flag image URL and ISO code.

curl "http://www.countrypuff.org/curl/v1/country/US/flag"

ISO and GEC code mappings for the country.

curl "http://www.countrypuff.org/curl/v1/country/JP/codes"

Raw CIA World Factbook data.

curl "http://www.countrypuff.org/curl/v1/country/BR/raw"

A single Factbook section (e.g. Geography, Economy).

curl "http://www.countrypuff.org/curl/v1/country/NG/section/Geography"

A single field by comma-separated path.

curl "http://www.countrypuff.org/curl/v1/country/US/field?path=Government,Capital,name,text"

Search within one country's fields.

curl "http://www.countrypuff.org/curl/v1/country/BR/search?q=oil"

JSON equivalents (/api/v1/...)

List all available countries.

curl "http://www.countrypuff.org/api/v1/countries"

Search countries by name.

curl "http://www.countrypuff.org/api/v1/countries/search?q=united"

Full country data. country_code accepts ISO alpha-2 (US), ISO alpha-3 (USA), GEC code (us), or country name.

curl "http://www.countrypuff.org/api/v1/country/US"

Short country summary.

curl "http://www.countrypuff.org/api/v1/country/US/summary"

Flag image URL and ISO code.

curl "http://www.countrypuff.org/api/v1/country/US/flag"

ISO and GEC code mappings for the country.

curl "http://www.countrypuff.org/api/v1/country/JP/codes"

Raw CIA World Factbook data.

curl "http://www.countrypuff.org/api/v1/country/BR/raw"

A single Factbook section (e.g. Geography, Economy).

curl "http://www.countrypuff.org/api/v1/country/NG/section/Geography"

A single field by comma-separated path.

curl "http://www.countrypuff.org/api/v1/country/US/field?path=Government,Capital,name,text"

Search within one country's fields.

curl "http://www.countrypuff.org/api/v1/country/BR/search?q=oil"

OpenAPI spec

The raw OpenAPI document.

curl "http://www.countrypuff.org/openapi.json"