{"_id":"565a60d433140c0d0033930c","category":{"_id":"563a4fcaa19edf0d00972321","__v":6,"pages":["563a50051846790d0089535e","564ba1cf5cc43717009bcfe9","565a60d433140c0d0033930c","5673222e47f7010d005bfd7c","56afd2f5d21e9c0d00b62962","56be2bff6cae110d00190c05"],"project":"55773a5ba042551900b002cb","version":"55773a5ba042551900b002ce","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-11-04T18:34:50.832Z","from_sync":false,"order":1,"slug":"guides","title":"Guides"},"parentDoc":null,"user":"546d17e2eb9cfd1400dd4529","__v":14,"project":"55773a5ba042551900b002cb","version":{"_id":"55773a5ba042551900b002ce","project":"55773a5ba042551900b002cb","__v":18,"createdAt":"2015-06-09T19:11:23.764Z","releaseDate":"2015-06-09T19:11:23.764Z","categories":["55773a5ca042551900b002cf","55773a6ce6063e0d00481380","55773ab007e7110d001043ec","55773abaa042551900b002d5","55773ac207e7110d001043ed","55773acb07e7110d001043ee","55773ad3a042551900b002d6","55773adce6063e0d00481383","55773ae4a042551900b002d7","55773af307e7110d001043ef","55773af907e7110d001043f0","55773b0407e7110d001043f1","563a4f7ad25e8919005f3f39","563a4fcaa19edf0d00972321","564a70dc4cd0521700523edf","564b797bcc472d0d00da9435","564b855b766d4923004e1fd1","59cd4b81935249001c77c48e"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Motherboard","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-29T02:20:04.291Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"Many resources are contained within events including results, program data, event images and start lists. As a result the Events API contains a large number of methods to explore.\n\n[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/9d5a74b5be18b9a80638)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Event Methods\"\n}\n[/block]\n**[Event Listings](https://developers.triathlon.org/docs/event-listings)** returns a filterable list of event objects. This method is useful for displaying event listings or all events that meet a criteria e.g. WTS events in 2016. This method will allow determining of the unique `event_id` parameter that is required in all subsequent request types. Below we explore each of the available methods and provide a sample query for each.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --header \\\"apikey: [[app:key]]\\\" \\\"https://api.triathlon.org/v1/events?category_id=351&start_date=2016-01-01&end_date=2017-01-01\\\"\",\n      \"language\": \"curl\",\n      \"name\": \"\"\n    }\n  ]\n}\n[/block]\n**[Retrieve Event Information](https://developers.triathlon.org/docs/retrieve-event-information)** returns a full event listing suitable for outputting an event detail page. This method also includes summary information for associated news, videos and images such that these results may be previewed without resorting to multiple API calls.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --header \\\"apikey: [[app:key]]\\\" \\\"https://api.triathlon.org/v1/events/97636\\\"\",\n      \"language\": \"curl\",\n      \"name\": \"\"\n    }\n  ]\n}\n[/block]\n**[Event Web Images](https://developers.triathlon.org/docs/event-web-images)** returns a list of gallery objects for the event web galleries (all subject to usage restrictions) that you will find on Triathlon.org.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --header \\\"apikey: [[app:key]]\\\" \\\"https://api.triathlon.org/v1/events/97636/images\\\"\",\n      \"language\": \"curl\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\n**[Event High Resolution Images](https://developers.triathlon.org/docs/event-high-resolution-images)** returns a list of gallery objects for High Resolution Images that were taken at the event (again all subject to usage restrictions).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --header \\\"apikey: [[app:key]]\\\" \\\"https://api.triathlon.org/v1/events/97636/hr_images\\\"\",\n      \"language\": \"curl\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\n**[Event News](https://developers.triathlon.org/docs/event-news)** returns an array of news objects for all articles that have been associated with the event.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --header \\\"apikey: [[app:key]]\\\" \\\"https://api.triathlon.org/v1/events/97636/news\\\"\",\n      \"language\": \"curl\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\n**[Event Videos](https://developers.triathlon.org/docs/event-videos)** returns an array of video objects for all videos that have been associated with the event.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --header \\\"apikey: [[app:key]]\\\" \\\"https://api.triathlon.org/v1/events/97636/videos\\\"\",\n      \"language\": \"curl\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\n**[Event Twitter](https://developers.triathlon.org/docs/event-twitter)** acts as a proxy for the Twitter API allowing users to query the Twitter account of the event simply by knowing the event_id.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --header \\\"apikey: [[app:key]]\\\" \\\"https://api.triathlon.org/v1/events/97636/twitter\\\"\",\n      \"language\": \"curl\",\n      \"name\": \"\"\n    }\n  ]\n}\n[/block]\n**[Event Related Events](https://developers.triathlon.org/docs/event-related-events)** returns an array of event objects for other events happening at the same venue.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --header \\\"apikey: [[app:key]]\\\" \\\"https://api.triathlon.org/v1/events/97636/related\\\"\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n**[Event Medal Tally](https://developers.triathlon.org/docs/event-medal-tally)** returns an Olympic-style medal tally for a given event_id\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --header \\\"apikey: [[app:key]]\\\" \\\"https://api.triathlon.org/v1/events/97636/medal_tally\\\"\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n**[Event Medal Country Breakdown](https://developers.triathlon.org/docs/event-medal-country-breakdown)** returns the athletes corresponding to a country_id that secured medals in a given event_id.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --header \\\"apikey: [[app:key]]\\\" \\\"https://api.triathlon.org/v1/events/97636/medal_tally/2356\\\"\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n**[Event Specifications](https://developers.triathlon.org/docs/event-specifications)** returns a list of all available event specifications that may be used to filter event searches.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --header \\\"apikey: [[app:key]]\\\" \\\"https://api.triathlon.org/v1/events/specifications\\\"\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n**[Event Categories](https://developers.triathlon.org/docs/event-categories)** returns a list of all available event categories that may be used to filter event searches.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl --header \\\"apikey: [[app:key]]\\\" \\\"https://api.triathlon.org/v1/events/categories\\\"\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Program Methods\"\n}\n[/block]\nRaces at an event are referred to as **programs**. So one event contains many programs such as Elite Men, Elite Women, U23 Men etc... A large amount of data is also held at the program level such as atmospheric conditions, entries and results.\n\n* **Program Listings** returns a filterable array of program objects for a given event_id.\n* **Retrieve Program Information** returns a full program listing for a given prog_id (and associated event_id). This method would return, if available, course distances, weather data and any associated notes.\n* **Program Entries** returns an array of athlete objects for a given prog_id (and associated event_id) representing the start list of a program. It is also possible to view the waitlist of an event in the future provided that the 30-day window before the event has been met.\n* **Program Results** returns an array of result objects for a given prog_id (and associated event_id).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Sample Usage\"\n}\n[/block]\nUsing the [World Triathlon Series](http://wts.triathlon.org/) website as an example to generate the following pages:\n\n* 2016 Calendar Listing - Use the Event Listings method specifying parameters of category_id=351, start_date=2016-01-01 and end_date=2016-01-01\n* [Start List Page ](http://wts.triathlon.org/start_lists/2015_itu_world_triathlon_abu_dhabi/270293) use the program entries method to generate a list of athletes. For the expanded athlete profile information simply use the associated athlete_id of each entry to make a request to the Retrieve Athlete Information method of the Athletes API.","excerpt":"","slug":"getting-started-with-events-api","type":"basic","title":"Getting Started with the Events API"}

Getting Started with the Events API


Many resources are contained within events including results, program data, event images and start lists. As a result the Events API contains a large number of methods to explore. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/9d5a74b5be18b9a80638) [block:api-header] { "type": "basic", "title": "Event Methods" } [/block] **[Event Listings](https://developers.triathlon.org/docs/event-listings)** returns a filterable list of event objects. This method is useful for displaying event listings or all events that meet a criteria e.g. WTS events in 2016. This method will allow determining of the unique `event_id` parameter that is required in all subsequent request types. Below we explore each of the available methods and provide a sample query for each. [block:code] { "codes": [ { "code": "curl --header \"apikey: [[app:key]]\" \"https://api.triathlon.org/v1/events?category_id=351&start_date=2016-01-01&end_date=2017-01-01\"", "language": "curl", "name": "" } ] } [/block] **[Retrieve Event Information](https://developers.triathlon.org/docs/retrieve-event-information)** returns a full event listing suitable for outputting an event detail page. This method also includes summary information for associated news, videos and images such that these results may be previewed without resorting to multiple API calls. [block:code] { "codes": [ { "code": "curl --header \"apikey: [[app:key]]\" \"https://api.triathlon.org/v1/events/97636\"", "language": "curl", "name": "" } ] } [/block] **[Event Web Images](https://developers.triathlon.org/docs/event-web-images)** returns a list of gallery objects for the event web galleries (all subject to usage restrictions) that you will find on Triathlon.org. [block:code] { "codes": [ { "code": "curl --header \"apikey: [[app:key]]\" \"https://api.triathlon.org/v1/events/97636/images\"", "language": "curl", "name": null } ] } [/block] **[Event High Resolution Images](https://developers.triathlon.org/docs/event-high-resolution-images)** returns a list of gallery objects for High Resolution Images that were taken at the event (again all subject to usage restrictions). [block:code] { "codes": [ { "code": "curl --header \"apikey: [[app:key]]\" \"https://api.triathlon.org/v1/events/97636/hr_images\"", "language": "curl", "name": null } ] } [/block] **[Event News](https://developers.triathlon.org/docs/event-news)** returns an array of news objects for all articles that have been associated with the event. [block:code] { "codes": [ { "code": "curl --header \"apikey: [[app:key]]\" \"https://api.triathlon.org/v1/events/97636/news\"", "language": "curl", "name": null } ] } [/block] **[Event Videos](https://developers.triathlon.org/docs/event-videos)** returns an array of video objects for all videos that have been associated with the event. [block:code] { "codes": [ { "code": "curl --header \"apikey: [[app:key]]\" \"https://api.triathlon.org/v1/events/97636/videos\"", "language": "curl", "name": null } ] } [/block] **[Event Twitter](https://developers.triathlon.org/docs/event-twitter)** acts as a proxy for the Twitter API allowing users to query the Twitter account of the event simply by knowing the event_id. [block:code] { "codes": [ { "code": "curl --header \"apikey: [[app:key]]\" \"https://api.triathlon.org/v1/events/97636/twitter\"", "language": "curl", "name": "" } ] } [/block] **[Event Related Events](https://developers.triathlon.org/docs/event-related-events)** returns an array of event objects for other events happening at the same venue. [block:code] { "codes": [ { "code": "curl --header \"apikey: [[app:key]]\" \"https://api.triathlon.org/v1/events/97636/related\"", "language": "curl" } ] } [/block] **[Event Medal Tally](https://developers.triathlon.org/docs/event-medal-tally)** returns an Olympic-style medal tally for a given event_id [block:code] { "codes": [ { "code": "curl --header \"apikey: [[app:key]]\" \"https://api.triathlon.org/v1/events/97636/medal_tally\"", "language": "curl" } ] } [/block] **[Event Medal Country Breakdown](https://developers.triathlon.org/docs/event-medal-country-breakdown)** returns the athletes corresponding to a country_id that secured medals in a given event_id. [block:code] { "codes": [ { "code": "curl --header \"apikey: [[app:key]]\" \"https://api.triathlon.org/v1/events/97636/medal_tally/2356\"", "language": "curl" } ] } [/block] **[Event Specifications](https://developers.triathlon.org/docs/event-specifications)** returns a list of all available event specifications that may be used to filter event searches. [block:code] { "codes": [ { "code": "curl --header \"apikey: [[app:key]]\" \"https://api.triathlon.org/v1/events/specifications\"", "language": "curl" } ] } [/block] **[Event Categories](https://developers.triathlon.org/docs/event-categories)** returns a list of all available event categories that may be used to filter event searches. [block:code] { "codes": [ { "code": "curl --header \"apikey: [[app:key]]\" \"https://api.triathlon.org/v1/events/categories\"", "language": "curl" } ] } [/block] [block:api-header] { "type": "basic", "title": "Program Methods" } [/block] Races at an event are referred to as **programs**. So one event contains many programs such as Elite Men, Elite Women, U23 Men etc... A large amount of data is also held at the program level such as atmospheric conditions, entries and results. * **Program Listings** returns a filterable array of program objects for a given event_id. * **Retrieve Program Information** returns a full program listing for a given prog_id (and associated event_id). This method would return, if available, course distances, weather data and any associated notes. * **Program Entries** returns an array of athlete objects for a given prog_id (and associated event_id) representing the start list of a program. It is also possible to view the waitlist of an event in the future provided that the 30-day window before the event has been met. * **Program Results** returns an array of result objects for a given prog_id (and associated event_id). [block:api-header] { "type": "basic", "title": "Sample Usage" } [/block] Using the [World Triathlon Series](http://wts.triathlon.org/) website as an example to generate the following pages: * 2016 Calendar Listing - Use the Event Listings method specifying parameters of category_id=351, start_date=2016-01-01 and end_date=2016-01-01 * [Start List Page ](http://wts.triathlon.org/start_lists/2015_itu_world_triathlon_abu_dhabi/270293) use the program entries method to generate a list of athletes. For the expanded athlete profile information simply use the associated athlete_id of each entry to make a request to the Retrieve Athlete Information method of the Athletes API.