# Countries API

> Returns country, continent and language reference data such as capitals, currencies, dialling codes, flags and language names.

Category: Utilities. Region: global. 8 endpoints at `https://api.hoshime.com/v1/countries/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/countries
## GET /v1/countries/country

One country by its ISO 3166 code: capital, currency, dialling code, continent and languages.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `code` | string | yes | ISO 3166 alpha-2 code, such as ID. (e.g. ID) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `capital` (string), `code` (string), `continent` (string), `currency` (string), `emoji` (string), `languages` (CountryLanguage[]), `languages[].name` (string), `name` (string), `phone` (string)

```bash
curl "https://api.hoshime.com/v1/countries/country?code=ID" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/countries/countries

Every country, or the countries of one continent, with capital and flag emoji.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `continent` | string | no | Two-letter continent code, such as AS or EU. Empty lists every country. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `capital` (string), `code` (string), `emoji` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/countries/countries" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/countries/continents

The seven continents with their two-letter codes, such as EU for Europe.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `code` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/countries/continents" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/countries/language

One language by its ISO 639-1 code: its English and native names and whether it is written right to left.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `code` | string | yes | ISO 639-1 language code, such as es. (e.g. es) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `code` (string), `name` (string), `native` (string), `rtl` (boolean)

```bash
curl "https://api.hoshime.com/v1/countries/language?code=es" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/countries/languages

Every language the country data names, with its code and English and native names.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `code` (string), `name` (string), `native` (string), `rtl` (boolean)

```bash
curl "https://api.hoshime.com/v1/countries/languages" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/countries/countriesByCurrency

The countries whose currency has the ISO 4217 code, such as EUR, with capital and flag emoji.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `currency` | string | yes | ISO 4217 currency code, such as EUR. (e.g. EUR) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `capital` (string), `code` (string), `emoji` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/countries/countriesByCurrency?currency=EUR" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/countries/countriesByName

The countries whose name contains the text, with capital and flag emoji. The match is case-sensitive: Ger finds Germany, ger does not.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Text in the country name with a capital first letter, such as Ger. (e.g. Ger) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `capital` (string), `code` (string), `emoji` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/countries/countriesByName?query=Ger" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/countries/states

The states, provinces or regions of one country with their codes, such as the US states or the provinces of Indonesia.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `code` | string | yes | ISO 3166 alpha-2 code, such as US. (e.g. ID) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `code` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/countries/states?code=ID" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
