> ## Documentation Index
> Fetch the complete documentation index at: https://lava.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# REST Countries

> Country metadata API providing population, currencies, languages, timezones, borders, and flag data for every country.

Country metadata API providing population, currencies, languages, timezones, borders, and flag data for every country. Best for workflows needing country-level reference data — internationalization, demographic comparisons, and enriching location data with country attributes. A simple, free alternative to World Bank indicators when you need country metadata rather than economic time series.

1 example endpoint available through Lava's AI Gateway. See the [REST Countries API docs](https://restcountries.com/) for full documentation.

<Info>This provider is **managed** — no additional setup required.</Info>

<Info>This is a **catch-all provider** — any valid URL under `https://restcountries.com/v3.1` is supported. Country data API. Construct URL as [https://restcountries.com/v3.1/\&#123;endpoint\&#125](https://restcountries.com/v3.1/\&#123;endpoint\&#125);. Common endpoints: /all, /name/\{name}, /alpha/\{code}, /currency/\{currency}, /lang/\{language}, /capital/\{capital}, /region/\{region}. The endpoints below are curated examples.</Info>

## Endpoints

### Search country by name

**GET** `https://restcountries.com/v3.1/name/japan` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://restcountries.com/v3.1/name/japan', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Frestcountries.com%2Fv3.1%2Fname%2Fjapan" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="All Providers" icon="grid" href="/gateway/supported-providers">
    Browse all supported AI providers
  </Card>

  <Card title="Forward Proxy" icon="route" href="/gateway/forward-proxy">
    Learn how to construct proxy URLs and authenticate requests
  </Card>
</CardGroup>
