Skip to content
API documentation
View as MarkdownOpen in Claude

Reference data

Fetch one country by its id

GET
/v1/country/{id}

The country with this _id, as listCountries lists it.

An id that no country has and the id of one of the reserved countries get the same answer, 404 not_found.

Parameters

Path parameters

NameTypeDescription
idrequiredstring

The country’s _id, from listCountries: 24 hexadecimal digits.

Responses

200 OK

Success: message is "Country fetched successfully.".

Body

  • successbooleanrequired

    Always true on a success.

    one oftrue

  • messagestringrequired

    exampleCountry fetched successfully.

  • dataobject · CountryResponserequired

    A country a student can be registered in.

    9 fields of data
    • _idstringrequired

      The country’s id: what country takes when you register or update a student.

      example6650a1b2c3d4e5f6a7b8c9d1

    • namestring

      The country’s name, in capitals.

      exampleUNITED STATES

    • iso3string

      The ISO 3166-1 alpha-3 code, in capitals.

      exampleUSA

    • iso2string

      The ISO 3166-1 alpha-2 code, in capitals. A student’s username starts with it.

      exampleUS

    • tzstring

      The IANA time zone a sitting on local time is read in for students in this country (see tz on a sitting).

      exampleAmerica/New_York

    • dialCodestring

      The international dialling code, with its +.

      example+1

    • flagstring

      The country’s flag, as an emoji.

      example🇺🇸

    • createdAtstring

      When the record was created.

      formatdate-timeexample2026-09-01T09:30:00.000Z

    • updatedAtstring

      When the record last changed.

      formatdate-timeexample2026-09-02T14:05:00.000Z

Headers

X-RateLimit-Limit integer

Requests your account may make to this operation per window (100).

X-RateLimit-Remaining integer

Requests left in the current window.

X-RateLimit-Reset integer

Seconds until the current window ends.

Example

{
  "success": true,
  "message": "Country fetched successfully.",
  "data": {
    "_id": "6650a1b2c3d4e5f6a7b8c9d1",
    "name": "UNITED STATES",
    "iso3": "USA",
    "iso2": "US",
    "tz": "America/New_York",
    "dialCode": "+1",
    "flag": "🇺🇸",
    "createdAt": "2026-09-01T09:30:00.000Z",
    "updatedAt": "2026-09-02T14:05:00.000Z"
  }
}

Example request

# $TOKEN: a short-lived token you minted with your API key and secret
curl -sS 'https://api.main-team.org/v1/country/<id>' \
  -H "Authorization: Bearer $TOKEN"

Search the API documentation

Guides, endpoints by name, path or permission, and error codes such as not_found.