Flavours API
Country

List Countries

GET
/api/v2/countries

List all countries with pagination and filtering options.

AuthorizationBearer <token>

You can retrieve your token by logging in.

In: header

Query Parameters

page?|

Page number for pagination. Must be at least 1.

per_page?|

Number of items per page. Must be at least 1.

search?|

Search term for filtering countries.

sort?|

Sort column (e.g. name, is_active).

key_by?|

Key response by column.

includes*array<>
filter?object
filter.countries_ids*array<>

The id of an existing record in the countries table.

filter.countries_codes*array<>

The code of an existing record in the countries table.

filter.countries_prefixes*array<>

The phone_prefix of an existing record in the countries table.

filter.countries_currencies*array<>

The currency of an existing record in the countries table.

filter.is_active?|

Filter by active status.

Header Parameters

X-API-Version*string

API contract version to target. See the Changelog for what changed in each version.

Default"2.0.0"
Value in"2.3.0" | "2.2.0" | "2.1.0" | "2.0.0"

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "http://localhost:8000/api/v2/countries?page=1&per_page=20&search=Saudi&sort=name&key_by=id&includes=aperiam&filter.countries_ids=dolor&filter.countries_codes=quis&filter.countries_prefixes=ut&filter.countries_currencies=illum&filter.is_active=true" \  -H "X-API-Version: 2.3.0"
{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Data Loaded Successfully"
  },
  "data": {
    "current_page": 1,
    "data": [
      {
        "id": 8,
        "flag": "🇧🇭",
        "name": "Bahrain",
        "currency": "BHD",
        "phone_prefix": "973",
        "phone_start": "8",
        "phone_max": 11,
        "deleted_at": null,
        "is_active": true,
        "code": "BH"
      },
      {
        "id": 5,
        "flag": "🇪🇬",
        "name": "Egypt",
        "currency": "EGP",
        "phone_prefix": "20",
        "phone_start": "2",
        "phone_max": 12,
        "deleted_at": null,
        "is_active": true,
        "code": "EG"
      },
      {
        "id": 7,
        "flag": "🇮🇶",
        "name": "Iraq",
        "currency": "IQD",
        "phone_prefix": "964",
        "phone_start": "1",
        "phone_max": 15,
        "deleted_at": null,
        "is_active": true,
        "code": "IQ"
      },
      {
        "id": 3,
        "flag": "🇯🇴",
        "name": "Jordan",
        "currency": "JOD",
        "phone_prefix": "962",
        "phone_start": "3",
        "phone_max": 14,
        "deleted_at": null,
        "is_active": true,
        "code": "JO"
      },
      {
        "id": 2,
        "flag": "🇰🇼",
        "name": "Kuwait",
        "currency": "KWD",
        "phone_prefix": "965",
        "phone_start": "4",
        "phone_max": 15,
        "deleted_at": null,
        "is_active": true,
        "code": "KW"
      },
      {
        "id": 15,
        "flag": "🇱🇧",
        "name": "Lebanon",
        "currency": "LBP",
        "phone_prefix": "961",
        "phone_start": "7",
        "phone_max": 13,
        "deleted_at": null,
        "is_active": true,
        "code": "LB"
      },
      {
        "id": 1,
        "flag": "🇲🇦",
        "name": "Morocco",
        "currency": "MAD",
        "phone_prefix": "212",
        "phone_start": "4",
        "phone_max": 11,
        "deleted_at": null,
        "is_active": true,
        "code": "MA"
      },
      {
        "id": 11,
        "flag": "🇸🇦",
        "name": "Saudi Arabia",
        "currency": "SAR",
        "phone_prefix": "966",
        "phone_start": "7",
        "phone_max": 14,
        "deleted_at": null,
        "is_active": true,
        "code": "SA"
      },
      {
        "id": 13,
        "flag": "🇸🇾",
        "name": "Syria",
        "currency": "SYP",
        "phone_prefix": "963",
        "phone_start": "6",
        "phone_max": 14,
        "deleted_at": null,
        "is_active": true,
        "code": "SY"
      },
      {
        "id": 6,
        "flag": "🇹🇳",
        "name": "Tunisia",
        "currency": "TND",
        "phone_prefix": "216",
        "phone_start": "3",
        "phone_max": 12,
        "deleted_at": null,
        "is_active": true,
        "code": "TN"
      },
      {
        "id": 14,
        "flag": "🇹🇷",
        "name": "Turkey",
        "currency": "TRY",
        "phone_prefix": "90",
        "phone_start": "5",
        "phone_max": 10,
        "deleted_at": null,
        "is_active": true,
        "code": "TR"
      },
      {
        "id": 10,
        "flag": "🇦🇪",
        "name": "United Arab Emirates",
        "currency": "AED",
        "phone_prefix": "971",
        "phone_start": "9",
        "phone_max": 10,
        "deleted_at": null,
        "is_active": true,
        "code": "AE"
      },
      {
        "id": 9,
        "flag": "🇾🇪",
        "name": "Yemen",
        "currency": "YER",
        "phone_prefix": "967",
        "phone_start": "9",
        "phone_max": 14,
        "deleted_at": null,
        "is_active": true,
        "code": "YE"
      },
      {
        "id": 4,
        "flag": "🇴🇲",
        "name": "Oman",
        "currency": "OMR",
        "phone_prefix": "968",
        "phone_start": "3",
        "phone_max": 13,
        "deleted_at": null,
        "is_active": false,
        "code": "OM"
      },
      {
        "id": 12,
        "flag": "🇶🇦",
        "name": "Qatar",
        "currency": "QAR",
        "phone_prefix": "974",
        "phone_start": "6",
        "phone_max": 12,
        "deleted_at": null,
        "is_active": false,
        "code": "QA"
      }
    ],
    "first_page_url": "http://localhost:8000/api/v2/countries?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "http://localhost:8000/api/v2/countries?page=1",
    "links": [
      {
        "url": null,
        "label": "&laquo; Previous",
        "page": null,
        "active": false
      },
      {
        "url": "http://localhost:8000/api/v2/countries?page=1",
        "label": "1",
        "page": 1,
        "active": true
      },
      {
        "url": null,
        "label": "Next &raquo;",
        "page": null,
        "active": false
      }
    ],
    "next_page_url": null,
    "path": "http://localhost:8000/api/v2/countries",
    "per_page": 20,
    "prev_page_url": null,
    "to": 15,
    "total": 15
  }
}
{
  "meta": {
    "code": 401,
    "status": "error",
    "message": "Unauthenticated."
  },
  "data": null
}
{
  "meta": {
    "code": 403,
    "status": "error",
    "message": "Unauthorized."
  },
  "data": null
}
{
  "meta": {
    "code": 404,
    "status": "error",
    "message": "Resource not found."
  },
  "data": null
}
{
  "meta": {
    "code": 500,
    "status": "error",
    "message": "Internal server error."
  },
  "data": null
}