tap-restcountries is a Singer tap for the REST Countries API (v3.1).
Built with the Meltano Tap SDK for Singer Taps.
Install from GitHub:
uv tool install git+https://github.com/ORG_NAME/tap-restcountries.git@main| Stream | Endpoint | Primary Key | Replication |
|---|---|---|---|
| countries | /all |
cca3 |
Full table |
| Setting | Type | Required | Default | Description |
|---|---|---|---|---|
api_url |
string | No | https://restcountries.com/v3.1 |
Base URL for the REST Countries API |
fields |
array | No | (all) | List of fields to request — see Fields below |
⚠️ Important: The REST Countries API enforces a maximum of 10 fields when calling the/allendpoint. If you need more fields, omit thefieldssetting entirely to retrieve the full response, or make multiple requests with different field selections.
Available fields: cca2, cca3, ccn3, cioc, fifa, independent, status,
unMember, name, altSpellings, translations, area, borders, capital,
capitalInfo, continents, landlocked, latlng, maps, region, subregion,
timezones, population, languages, demonyms, currencies, idd, tld,
postalCode, startOfWeek, car, gini, flag, flags, coatOfArms.
Example configuration selecting specific fields:
{
"fields": ["name", "cca2", "cca3", "capital", "region", "population"]
}This Singer tap will automatically import any environment variables within the working directory's
.env if the --config=ENV is provided, such that config values will be considered if a matching
environment variable is set either in the terminal context or in the .env file.
export TAP_RESTCOUNTRIES_API_URL=https://restcountries.com/v3.1
export TAP_RESTCOUNTRIES_FIELDS='["name","cca2","capital"]'No authentication is required. The REST Countries API is free and open.
You can easily run tap-restcountries by itself or in a pipeline using Meltano.
tap-restcountries --version
tap-restcountries --help
tap-restcountries --config CONFIG --discover > ./catalog.jsonFollow these instructions to contribute to this project.
Prerequisites:
- Python 3.10+
- uv
uv syncCreate tests within the tests subfolder and
then run:
uv run pytestYou can also test the tap-restcountries CLI interface directly using uv run:
uv run tap-restcountries --helpTesting with Meltano
Note: This tap will work in any Singer environment and does not require Meltano. Examples here are for convenience and to streamline end-to-end orchestration scenarios.
Use Meltano to run an EL pipeline:
# Install meltano
uv tool install meltano
# Test invocation
meltano invoke tap-restcountries --version
# Run a test EL pipeline
meltano run tap-restcountries target-jsonlSee the dev guide for more instructions on how to use the SDK to develop your own taps and targets.