Result Format

Documentation

The **Results** method searches a specified collection and returns a corresponding basic object for each. See the [Search API overview](https://developers.triathlon.org/docs/search-api-overview) for a listing of all collections.
The `query` parameter performs a fuzzy search on a number of different parameters, e.g. for the athletes index a search for *Brownlee* will search the article title, article excerpt and associated tags.
If you wish to search multiple collections for the best possible user experience it is suggested that you make, and present, individual queries of the separate collections such that you can set the parameters on each accordingly.
[block:callout]
{
"type": "danger",
"body": "We don’t recommend to merge the results of several queries in a single results list because their ranking criteria are often non-comparable: rather display them in separated sections."
}
[/block]
You may apply additional [filters](https://developers.triathlon.org/docs/search-api-overview#filters), [dates](https://developers.triathlon.org/docs/search-api-overview#dates) and [geo-searching](https://developers.triathlon.org/docs/search-api-overview#geo-searching) parameters to your queries to refine search results.
[block:api-header]
{
"type": "basic",
"title": "Examples"
}
[/block]
Find all athletes with *Gwen* in their name.
[block:code]
{
"codes": [
{
"code": "curl --header \"apikey: [[app:key]]\" \"https://api.triathlon.org/v1/search/athletes?query=gwen\"",
"language": "json"
}
]
}
[/block]
Restrict an athlete search to elite only athletes (those athletes with a current points list ranking).
[block:code]
{
"codes": [
{
"code": "curl --header \"apikey: [[app:key]]\" \"https://api.triathlon.org/v1/search/athletes?filters=athlete_gender,male|elite,true\"",
"language": "json"
}
]
}
[/block]
List events that are closest to a certain location (to find events in the future add an applicable `start_date`).
[block:code]
{
"codes": [
{
"code": "curl --header \"apikey: [[app:key]]\" \"https://api.triathlon.org/v1/search/events?location=49.246292,-123.116226\"",
"language": "json"
}
]
}
[/block]