Table of Contents

    API

    Mock Server

    Use this URL to access a mockup of the API server. Your traffic will be recorded and compared to the documentation. You'll find your traffic analysis in the inspector or directly here in the documentation, right next to each resource.

Sochi 2014 Winter Olympics

Documentation for Sochi 2014 Winter Olympics API

Athletes

Athletes related resources. An athlete object has the following attributes:

  • Id
  • First Name
  • Last Name
  • Country
  • Gender
  • birthdate
  • Height
  • Weight
  • Gold Medals
  • Silver Medals
  • Bronze Medals

List of all athletes

GET

/api/athlete

Returns a list of all athletes and their ids.

Response

200 (OK)
Content-Type: application/json
[
    {
        "id": 6,
        "first_name": "Meghan",
        "last_name": "Agosta",
        "country": 7,
        "gender": "Female",
        "birthdate": "1987-02-12",
        "height": "1.68 m (5' 6'')",
        "weight": "67 kg / 148 lbs",
        "gold_medals": [11],
        "silver_medals": [],
        "bronze_medals": []
    },
    {
        "id": 4,
        "first_name": "Victor",
        "last_name": "An",
        "country": 5,
        "gender": "Male",
        "birthdate": "1985-11-23",
        "height": "1.70 m (5' 7'')",
        "weight": "65 kg / 143 lbs",
        "gold_medals": [5,6,7],
        "silver_medals": [],
        "bronze_medals": [8]
    },
    ...
]

Retrieve an Athlete

GET

/api/athlete/{id}

Returns the details of an athlete.

Parameters
Name Description Details
id

id of the Athlete to perform action with, found at API/athletes. 1-10.

integer, required
example: 6

Response

200 (OK)
Content-Type: application/json
    {
        "id": 6,
        "first_name": "Meghan",
        "last_name": "Agosta",
        "country": 7,
        "gender": "Female",
        "birthdate": "1987-02-12",
        "height": "1.68 m (5' 6'')",
        "weight": "67 kg / 148 lbs",
        "gold_medals": [11],
        "silver_medals": [],
        "bronze_medals": []
    }

Response

404 (Not Found)
Content-Type: application/json
{
    "message":"error",
    "errors":["not found"]
}

Countries

Countries related resources. A country has the following attributes:

  • Id
  • Name
  • Description
  • Total of Gold Medals
  • Total of Silver Medals
  • Total of Bronze Medals
  • List of Athletes

List of all Countries

GET

/api/country

Returns a list of countries and their ids.

Response

200 (OK)
Content-Type: application/json
[
    {
        "id": 9,
        "name": "Austria",
        "description": "Austrian athletes have an outstanding record in winter Olympic competition, particularly in alpine skiing where they have won more medals than any other nation.",
        "total_gold_medals": 4,
        "total_silver_medals": 8,
        "total_bronze_medals": 5,
        "athletes": [8]
    },
    {
        "id": 10,
        "name": "Belarus",
        "description": "Belarus first competed as an independent nation at the Olympic Winter Games in 1994. They won two silver medals at the 1994 Lillehammer Games with biathlete Svetlana Paramygina taking second in the 7.5km event, and speed skater Igor Zhelezovski finishing runner-up in the 1000m.   Biathlon provided a further two medals in Vancouver in 2010, with Sergei Novikov finishing with the silver medal in the men's 20km individual and Darya Domracheva claiming bronze in the women's 15km individual.",
        "total_gold_medals": 5,
        "total_silver_medals": 0,
        "total_bronze_medals": 1,
        "athletes": [9]
    },
    ...
]

Retrieve a Country

GET

/api/country/{id}

Parameters
Name Description Details
id

id of the Country to perform action with, found at API/country.

integer, required
example: 9

Response

200 (OK)
Content-Type: application/json
    {
        "id": 9,
        "name": "Austria",
        "description": "Austrian athletes have an outstanding record in winter Olympic competition, particularly in alpine skiing where they have won more medals than any other nation.",
        "total_gold_medals": 4,
        "total_silver_medals": 8,
        "total_bronze_medals": 5,
        "athletes": [8]
    }

Response

404 (Not Found)
Content-Type: application/json
{
    "message":"error",
    "errors":["not found"]
}

Events

Events related resources. An event has the following attributes:

  • Id
  • Name (This consists of the event's name and its associated sport)
  • Description (Wiki link)
  • Sport
  • Gold Medalist(s)
  • Silver Medalist(s)
  • Bronze Medalist(s)

List of all Events

GET

/api/event

Response

200 (OK)
Content-Type: application/json
[
    {
        "id": 15,
        "name": "Women's Giant Slalom",
        "sport": "Alpine Skiing",
        "desc": "In the giant slalom, the gates are placed farther apart than in the slalom, but not as far apart as in the super-G. Men\u2019s races have 56 to 70 gates, while ladies\u2019 have 46 to 58. The result is the sum of the skier\u2019s times on two different courses.",
        "gold_medalists": [],
        "silver_medalists": [8],
        "bronze_medalists": []
    },
    {
        "id": 14,
        "name": "Women's Super G",
        "sport": "Alpine Skiing",
        "desc": "The super giant (Super-G) incorporates aspects of both the downhill and the giant slalom. In the super giant, athletes achieve speeds just as high as in the downhill, but the course trajectory is similar to the course trajectory in the slalom. Athletes ski a course on which the gates are placed at about the same distance apart as in the giant slalom. Each skier gets only one attempt at the course.",
        "gold_medalists": [8],
        "silver_medalists": [],
        "bronze_medalists": []
    },
    ...
]

Retrieve an event

GET

/api/event/{id}

Parameters
Name Description Details
id

id of the event to perform action with, found at API/event 1-19.

integer, required
example: 15

Response

200 (OK)
Content-Type: application/json
{
        "id": 15,
        "name": "Women's Giant Slalom",
        "sport": "Alpine Skiing",
        "desc": "In the giant slalom, the gates are placed farther apart than in the slalom, but not as far apart as in the super-G. Men\u2019s races have 56 to 70 gates, while ladies\u2019 have 46 to 58. The result is the sum of the skier\u2019s times on two different courses.",
        "gold_medalists": [],
        "silver_medalists": [8],
        "bronze_medalists": []
}

Response

404 (Not Found)
Content-Type: application/json
{
    "message":"error",
    "errors":["not found"]
}