---
title: "Pobierz listę krajów"
description: "Zakres: `api:invoices:read`. Sortowane po nazwie polskiej, chyba że podano `order`. `limit` nie jest ograniczany.\n`polish_name` nie działa w filtrach ani w `order` (jest ignorowane), a w `fields` powoduje `500`."
---

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

Path: inFakt API › Słowniki

`GET /countries.json`

Zakres: `api:invoices:read`. Sortowane po nazwie polskiej, chyba że podano `order`. `limit` nie jest ograniczany.
`polish_name` nie działa w filtrach ani w `order` (jest ignorowane), a w `fields` powoduje `500`.

## Authentication

Requires one of the following:

- `ApiKey`, apiKey, in header, header `X-inFakt-ApiKey`
- `Token`, apiKey, in header, header `X-Token`

## Query parameters

- `page` (`Dictionaries_listCountries.query.page`; integer, optional) — Numer strony liczony od 1; ignorowany, gdy wysłany jest `offset`.
  - format `int32`; default `1`
- `per_page` (`Dictionaries_listCountries.query.per_page`; integer, optional) — Liczba wyników na stronę przy `page`. Serwer jej nie ogranicza.
  - format `int32`; default `10`
- `offset` (`Dictionaries_listCountries.query.offset`; integer, optional) — Indeks pierwszego wyniku (liczba pomijanych encji).
  - format `int32`
- `limit` (`Dictionaries_listCountries.query.limit`; integer, optional) — Liczba wyników na stronę przy `offset`; domyślnie 10, ignorowana bez `offset`. Większość list bez błędu obniża wartości powyżej 100 do 100.
  - format `int32`
- `pagination_without_total` (`Dictionaries_listCountries.query.pagination_without_total`; boolean, optional) — Pomiń liczenie; `metainfo.total_count` przyjmuje wartość `null`.
- `fields` (`Dictionaries_listCountries.query.fields`; string, optional) — Zawężenie pól: nazwy pól API rozdzielone przecinkami, np. `id,company_name`; `id` jest zwykle dodawane. Odpowiedź zawiera wtedy tylko te pola, więc nie odpowiada pełnemu schematowi. Pola wyliczane, a nie zapisywane, mogą kończyć się błędem `500`; operacja je wymienia.
- `order` (`Dictionaries_listCountries.query.order`; string, optional) — Sortowanie: `<pole>`, `<pole> asc` albo `<pole> desc` z nazwą pola API, np. `name desc`. Pole, po którym nie da się sortować, jest ignorowane bez błędu.
- `q[alpha_2_eq]` (`Dictionaries_listCountries.query.q[alpha_2_eq]`; string, optional) — Kod dwuliterowy równy, np. `DE`.
- `q[english_name_eq]` (`Dictionaries_listCountries.query.q[english_name_eq]`; string, optional) — Nazwa angielska równa, np. `Poland`.
- `q[english_name_cont]` (`Dictionaries_listCountries.query.q[english_name_cont]`; string, optional) — Nazwa angielska zawiera.
- `q[european_union_eq]` (`Dictionaries_listCountries.query.q[european_union_eq]`; boolean, optional, deprecated) — Historyczny filtr po `european_union`, które zawsze ma wartość `false`.

## Code samples

### cURL

```bash
curl --request GET \
  --url https://api.sandbox-infakt.pl/v3/countries.json \
  --header 'X-inFakt-ApiKey: <X-inFakt-ApiKey>'
```

### TypeScript

```typescript
const url = 'https://api.sandbox-infakt.pl/v3/countries.json';
const options = {method: 'GET', headers: {'X-inFakt-ApiKey': '<X-inFakt-ApiKey>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sandbox-infakt.pl/v3/countries.json"

headers = {"X-inFakt-ApiKey": "<X-inFakt-ApiKey>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

Sukces

#### Example

```json
{
  "metainfo": {
    "count": 1,
    "total_count": 212,
    "next": "https://api.infakt.pl/v3/countries.json?limit=1&offset=1",
    "previous": "https://api.infakt.pl/v3/countries.json?limit=1&offset=0"
  },
  "entities": [
    {
      "id": 1,
      "alpha_2": "AF",
      "alpha_3": "AFG",
      "english_name": "Afghanistan",
      "polish_name": "Afganistan",
      "continent": "Azja",
      "european_union": false,
      "currency": "AFN"
    }
  ]
}
```

- `metainfo` (`Dictionaries_listCountries.response.200.metainfo`; object, required)
  - `count` (`Dictionaries_listCountries.response.200.metainfo.count`; integer, required) — Liczba encji na tej stronie.
    - format `int32`
  - `total_count` (`Dictionaries_listCountries.response.200.metainfo.total_count`; any of, required) — Liczba pasujących encji; `null`, gdy `pagination_without_total=true`.
    - any of: `integer`, `null`
  - `next` (`Dictionaries_listCountries.response.200.metainfo.next`; string, required) — Bezwzględny URL następnej strony w postaci `offset`/`limit`.
  - `previous` (`Dictionaries_listCountries.response.200.metainfo.previous`; string, required) — Bezwzględny URL poprzedniej strony w postaci `offset`/`limit`.
- `entities` (`Dictionaries_listCountries.response.200.entities`; array<object>, required)
  - `id` (`Dictionaries_listCountries.response.200.entities.id`; integer, required)
    - format `int64`
  - `alpha_2` (`Dictionaries_listCountries.response.200.entities.alpha_2`; string, required) — ISO 3166-1 alpha-2, z wyjątkiem `EL` dla Grecji i `XI` dla Irlandii Północnej. Używaj jako `country` klienta.
    - pattern `^[A-Z]{2}$`
  - `alpha_3` (`Dictionaries_listCountries.response.200.entities.alpha_3`; string, required)
    - pattern `^[A-Z]{3}$`
  - `english_name` (`Dictionaries_listCountries.response.200.entities.english_name`; string, required)
  - `polish_name` (`Dictionaries_listCountries.response.200.entities.polish_name`; string, required)
  - `continent` (`Dictionaries_listCountries.response.200.entities.continent`; string, required) — Nazwa kontynentu po polsku.
  - `european_union` (`Dictionaries_listCountries.response.200.entities.european_union`; boolean, required, deprecated) — Pole historyczne, zawsze `false`. Nie odzwierciedla członkostwa w UE.
  - `currency` (`Dictionaries_listCountries.response.200.entities.currency`; any of, required) — Kod ISO 4217 waluty krajowej.
    - any of: `string`, `null`

### 400

Nieprawidłowe parametry wyszukiwania (`q[...]`); na niektórych endpointach także nieprawidłowe parametry stronicowania.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`Dictionaries_listCountries.response.400.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`Dictionaries_listCountries.response.400.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`Dictionaries_listCountries.response.400.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Dictionaries_listCountries.response.400.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Dictionaries_listCountries.response.400.url`; string, optional)
- `action_url` (`Dictionaries_listCountries.response.400.action_url`; string, optional)

### 401

Brak klucza API, nieprawidłowy klucz albo klucz bez wymaganego zakresu uprawnień.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`Dictionaries_listCountries.response.401.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`Dictionaries_listCountries.response.401.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`Dictionaries_listCountries.response.401.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Dictionaries_listCountries.response.401.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Dictionaries_listCountries.response.401.url`; string, optional)
- `action_url` (`Dictionaries_listCountries.response.401.action_url`; string, optional)

### 402

API niedostępne w obecnym planie (`limit: plan_upgrade_needed`) albo osiągnięty limit dokumentów.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`Dictionaries_listCountries.response.402.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`Dictionaries_listCountries.response.402.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`Dictionaries_listCountries.response.402.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Dictionaries_listCountries.response.402.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Dictionaries_listCountries.response.402.url`; string, optional)
- `action_url` (`Dictionaries_listCountries.response.402.action_url`; string, optional)

### 406

Ścieżka nie kończy się na `.json`.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`Dictionaries_listCountries.response.406.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`Dictionaries_listCountries.response.406.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`Dictionaries_listCountries.response.406.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Dictionaries_listCountries.response.406.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Dictionaries_listCountries.response.406.url`; string, optional)
- `action_url` (`Dictionaries_listCountries.response.406.action_url`; string, optional)

### 423

Niepotwierdzony adres e-mail albo wymagana weryfikacja tożsamości.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`Dictionaries_listCountries.response.423.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`Dictionaries_listCountries.response.423.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`Dictionaries_listCountries.response.423.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Dictionaries_listCountries.response.423.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Dictionaries_listCountries.response.423.url`; string, optional)
- `action_url` (`Dictionaries_listCountries.response.423.action_url`; string, optional)

### 429

Przekroczony limit zapytań. Komunikat jest po angielsku, np. `API rate limit exceeded. Try again in 60 seconds.`

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`Dictionaries_listCountries.response.429.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`Dictionaries_listCountries.response.429.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`Dictionaries_listCountries.response.429.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Dictionaries_listCountries.response.429.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Dictionaries_listCountries.response.429.url`; string, optional)
- `action_url` (`Dictionaries_listCountries.response.429.action_url`; string, optional)


Source: https://docs.niebieskiorzel.pl/api/countries-json/list/index.md
