API Docs

Countries API

Destination countries with their codes, flag and image URLs. Use a country's _id or code to filter visas.

Base URL https://api.vismora.com

Search countries

GET /api/countries/search

Case-insensitive search on country name or code. The query must be at least 3 characters.

Parameters

NameInDescription
q required
string
query Search text, at least 3 characters.
limit optional
integer
query Maximum results. Maximum 100.
Default: 20

Response fields

FieldTypeDescription
success boolean
query string The search text used.
count integer
countries array of objects
countries[]._id string
countries[].name string
countries[].code string ISO 3166-1 alpha-2 code, e.g. TH.
countries[].flag string (uri) Flag image URL.
countries[].image string (uri) Destination image URL.
countries[].showOnHomepage boolean Only returned by GET /api/countries/{id}.

Responses

StatusMeaning
200 Matching countries.
400 The search text is shorter than 3 characters.
401 The token is missing, invalid or expired. Log in again.
403 The account was disabled, unapproved or had API access turned off after the token was issued.
429 Rate limit reached. Wait for the number of seconds in the Retry-After header, then retry.
500 Something went wrong on our side. Retry later, and contact support if it continues.

Request

curl -X GET "https://api.vismora.com/api/countries/search?q=thai" \
  -H "Authorization: Bearer $VISMORA_TOKEN"

Response 200

{
  "success": true,
  "query": "thai",
  "count": 1,
  "countries": [
    {
      "_id": "664a0b1c2d3e4f5a6b7c8da0",
      "name": "Thailand",
      "code": "TH",
      "flag": "https://flagcdn.com/w80/th.png",
      "image": "https://…/thailand.jpg"
    }
  ]
}

Response 400

{
  "success": false,
  "error": "Search query must be at least 3 characters long"
}

List countries

GET /api/countries/list

All active countries, sorted by name.

Parameters

NameInDescription
limit optional
integer
query Maximum results. Maximum 500.
Default: 100

Response fields

FieldTypeDescription
success boolean
count integer
countries array of objects
countries[]._id string
countries[].name string
countries[].code string ISO 3166-1 alpha-2 code, e.g. TH.
countries[].flag string (uri) Flag image URL.
countries[].image string (uri) Destination image URL.
countries[].showOnHomepage boolean Only returned by GET /api/countries/{id}.

Responses

StatusMeaning
200 Countries.
401 The token is missing, invalid or expired. Log in again.
403 The account was disabled, unapproved or had API access turned off after the token was issued.
429 Rate limit reached. Wait for the number of seconds in the Retry-After header, then retry.
500 Something went wrong on our side. Retry later, and contact support if it continues.

Request

curl -X GET "https://api.vismora.com/api/countries/list" \
  -H "Authorization: Bearer $VISMORA_TOKEN"

Response 200

{
  "success": true,
  "count": 2,
  "countries": [
    {
      "_id": "664a0b1c2d3e4f5a6b7c8da0",
      "name": "Thailand",
      "code": "TH",
      "flag": "https://flagcdn.com/w80/th.png",
      "image": "https://…/thailand.jpg"
    },
    {
      "_id": "664a0b1c2d3e4f5a6b7c8d9e",
      "name": "United Arab Emirates",
      "code": "AE",
      "flag": "https://flagcdn.com/w80/ae.png",
      "image": "https://…/uae.jpg"
    }
  ]
}

Response 401

{
  "success": false,
  "error": "Invalid or expired token. Please login again."
}

Get a country

GET /api/countries/{id}

Returns one country by its _id or its code.

Parameters

NameInDescription
id required
string
path Country _id or code, e.g. TH.

Response fields

FieldTypeDescription
success boolean
country object
country._id string
country.name string
country.code string ISO 3166-1 alpha-2 code, e.g. TH.
country.flag string (uri) Flag image URL.
country.image string (uri) Destination image URL.
country.showOnHomepage boolean Only returned by GET /api/countries/{id}.

Responses

StatusMeaning
200 The country.
401 The token is missing, invalid or expired. Log in again.
403 The account was disabled, unapproved or had API access turned off after the token was issued.
404 No active country with that ID or code.
429 Rate limit reached. Wait for the number of seconds in the Retry-After header, then retry.
500 Something went wrong on our side. Retry later, and contact support if it continues.

Request

curl -X GET "https://api.vismora.com/api/countries/6661b2c3d4e5f6a7b8c9d0e1" \
  -H "Authorization: Bearer $VISMORA_TOKEN"

Response 200

{
  "success": true,
  "country": {
    "_id": "664a0b1c2d3e4f5a6b7c8da0",
    "name": "Thailand",
    "code": "TH",
    "flag": "https://flagcdn.com/w80/th.png",
    "image": "https://…/thailand.jpg",
    "showOnHomepage": true
  }
}

Response 401

{
  "success": false,
  "error": "Invalid or expired token. Please login again."
}