Nav button

Sports API

sports.api.decathlon.com provides a RESTful API that allows you to lookup intelligence, data and content related to sports.

Getting started

Sport Data Structure

    {
    "id": 66,
    "type": "sport",
    "attributes": {
        "name": "Skiing",
        "description": "On your skis, these longs and narrows kinds of skates, you can practice several disciplines that will transport you, for fun or during competitions, in the heart of the most beautiful winter landscapes. You’ll be able to ride down the hills at a fast pace and execute controlled turns, allowing you to take fresh air and strengthen your cardiovascular system. Have a fun ride!",
        "parent_id": null,
        "decathlon_id": 66,
        "slug": "skiing",
        "locale": "en",
        "weather": []
    },
    "relationships": {
        "children": {
            "data": [
                {
                    "id": 67,
                    "type": "sport"
                },
                {
                    "id": 785,
                    "type": "sport"
                },
                {
                    "id": 786,
                    "type": "sport"
                },
                {
                    "id": 787,
                    "type": "sport"
                },
                {
                    "id": 788,
                    "type": "sport"
                },
                {
                    "id": 789,
                    "type": "sport"
                },
                {
                    "id": 790,
                    "type": "sport"
                },
                {
                    "id": 791,
                    "type": "sport"
                },
                {
                    "id": 792,
                    "type": "sport"
                },
                {
                    "id": 68,
                    "type": "sport"
                }
            ]
        },
        "parent": {
            "data": null
        },
        "group": {
            "data": {
                "id": 22,
                "type": "group"
            }
        },
        "related": {
            "data": [
                {
                    "id": 156,
                    "type": "sport"
                },
                {
                    "id": 328,
                    "type": "sport"
                },
                {
                    "id": 70,
                    "type": "sport"
                }
            ]
        },
        "tags": {
            "data": [
                "downhill-skiing",
                "extreme-skiing",
                "giant-slalom",
                "glade-skiing",
                "grass-skiing",
                "skiing-on-grass",
                "para-alpine-skiing",
                "slalom",
                "speed-skiing",
                "super-g",
                "skis",
                "descent",
                "ski-station",
                "ski-slope",
                "glading"
            ]
        },
        "images": {
            "data": [
                {
                    "id": 170,
                    "url": "https://sports.api.decathlon.com/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBYW89IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--150627d59a77c19909396ed9ee88146eb35f2f26/ski.jpg",
                    "meta": {
                        "width": 500,
                        "height": 333
                    },
                    "variants": [
                        {
                            "thumbnail": {
                                "url": "https://sports.api.decathlon.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBYW89IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--150627d59a77c19909396ed9ee88146eb35f2f26/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lJTWpBd0Jqb0dSVlE9IiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--8ed889d31ac3a5e9d5446846a4f7747f8eaa0bc1/ski.jpg"
                            },
                            "medium": {
                                "url": "https://sports.api.decathlon.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBYW89IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--150627d59a77c19909396ed9ee88146eb35f2f26/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lKTVRBeU5BWTZCa1ZVIiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--0e36b4a54e8a5057a18945f67d3ad11a9ef22382/ski.jpg"
                            }
                        }
                    ]
                }
            ]
        }
    }
}

Authentication

No authentication is required. The API is fully OPEN and will stay as such. Keep in mind that a throttle will eventually be imposed on users that have not registered for an key.

Make your first API call

You are ready to go! We suggest making your first API call by querying for popular sports recommendations near you

Signup to our newsletter to be made aware of the upcoming changes ##Tutorial

API Reference

Given an application source (or multiple), coordinates and a search query: the endpoint will return you with a list of relevant sports based on language recognition, synonyms, lexical champ, tags, descriptions. Prior to being returned, the list will be reindexed based on the popularity of each sport in the vicinity of the given coordinates.

Showcase

To easily play around with the various parameters, we built a showcase

curl "https://sports.api.decathlon.com/sports/search/:query?source=:source&coordinates=:coordinates"

JSON response:

[
    {
        "id": 224,
        "type": "sport",
        "attributes": {
            "name": "Swimming",
            "description": "Swimming includes several sports that are practiced on the surface and/or under the water. It allows you to use your whole body to move, sometimes in speed trials, sometimes in artistic routines, but requiring at all times a great coordination. Above all, thanks to the effect of gravity, swimming helps to minimize the impact of force on your body and joints, in addition to being a complete and very accessible sport that can easily allow you to feel like a fish in the water!\n",
            "parent_id": null,
            "decathlon_id": 224,
            "slug": "swimming",
            "locale": "en",
            "weather": []
        },
        "relationships": {
            "children": {
                "data": [
                    {
                        "id": 331,
                        "type": "sport"
                    },
                    {
                        "id": 385,
                        "type": "sport"
                    },
                    {
                        "id": 406,
                        "type": "sport"
                    },
                    {
                        "id": 228,
                        "type": "sport"
                    },
                    {
                        "id": 500,
                        "type": "sport"
                    },
                    {
                        "id": 501,
                        "type": "sport"
                    }
                ]
            },
            "parent": {
                "data": null
            },
            "group": {
                "data": {
                    "id": 1,
                    "type": "group"
                }
            },
            "related": {
                "data": [
                    {
                        "id": 219,
                        "type": "sport"
                    },
                    {
                        "id": 405,
                        "type": "sport"
                    },
                    {
                        "id": 12,
                        "type": "sport"
                    }
                ]
            },
            "tags": {
                "data": [
                    "bathing",
                    "swimming-pool",
                    "triathlon",
                    "crawl",
                    "breaststroke",
                    "butterfly",
                    "backstroke",
                    "freestyle",
                    "open-water-swimming",
                    "marathon-swimming",
                    "synchronized-swimming",
                    "paralympic-swimming",
                    "aqualearning",
                    "competitive-swimming"
                ]
            },
            "images": {
                "data": [
                    {
                        "id": 204,
                        "url": "https://sports.api.decathlon.com/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBY3c9IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--cb60fb5bcf08e4676adace5cf677d12196bafe55/swimming.jpg",
                        "meta": {
                            "width": 500,
                            "height": 333
                        },
                        "variants": [
                            {
                                "thumbnail": {
                                    "url": "https://sports.api.decathlon.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBY3c9IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--cb60fb5bcf08e4676adace5cf677d12196bafe55/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lJTWpBd0Jqb0dSVlE9IiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--8ed889d31ac3a5e9d5446846a4f7747f8eaa0bc1/swimming.jpg"
                                },
                                "medium": {
                                    "url": "https://sports.api.decathlon.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBY3c9IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--cb60fb5bcf08e4676adace5cf677d12196bafe55/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lKTVRBeU5BWTZCa1ZVIiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--0e36b4a54e8a5057a18945f67d3ad11a9ef22382/swimming.jpg"
                                }
                            }
                        ]
                    }
                ]
            }
        }
    },
    {
        "id": 219,
        "type": "sport",
        "attributes": {
            "name": "Aquafit",
    //...

Query parameters

Parameter Default Example Description
query water Filter sports by their relevance to your query.
source popular One of : popular, decathlon, activities, places, events
coordinates User's geolocation from IP -73.5826985,45.5119864 Sport popularity is geolocalized.
has_decathlon_id false true Will only return sports containing a Decathlon ID
parents_only false true Will only return sports that have parent_id: null
details true false If false, will return a minified payload
strict false true If true, will strictly search for sport who's name contains the query

Listing

curl "https://sports.api.decathlon.com/sports"

JSON response:

{
    "data": [
        {
            "id": "224",
            "type": "sport",
            "attributes": {
                "name": "Swimming",
                "description": null,
                "parent_id": null,
                "decathlon_id": 224,
                "slug": "swimming",
                "locale": "en",
                "weather": []
            },
            "relationships": {
                    "tags": {
                    "data": [
                        "bathing",
                        "swimming-pool",
                        "triathlon",
                        "crawl",
                        "breaststroke",
                        "butterfly",
                        "backstroke",
                        "freestyle",
                        "open-water-swimming",
                        "marathon-swimming",
                        "synchronized-swimming",
                        "paralympic-swimming",
                        "aqualearning",
                        "competitive-swimming"
                    ]
                    },
                "children": {
                    "data": [
                        {
                            "id": "331",
                            "type": "sport"
                        },
                        {
                            "id": "219",
                            "type": "sport"
                        },
                        {
                            "id": "405",
                            "type": "sport"
                        },
                        {
                            "id": "449",
                            "type": "sport"
                        },
                        {
                            "id": "224",
                            "type": "sport"
                        }
                    ]
                }
            }
        },
        {
            "id": "291",
            "type": "sport",
            "attributes": {
                "name": "Body Building / Cross Training",
                "description": null,
                "parent_id": 486,
                "slug": "body-building-cross-training",
                "locale": "en"
            },
            "relationships": {
                "parent": {
                    "data": {
                        "id": "486",
                        "type": "sport"
                    }
                }
            }
        },
        //...
    ]
}

While the search endpoint has a looser interpretation, the sports endpoint is considered strict
Default when not passing a query is to return the entire list.

HTTP Request

GET https://sports.api.decathlon.com/sports

Query Parameters

Search query errors will be rescued with specific error messages, and an HTTP 404 status code.

Parameter Example Description
q socc Query a sport by its name, using a string for searching
tag winter Filter sports by a tag.
decathlon_id 175 Search sports by Decathlon's legacy ID
parents_only true Boolean parameter to display parent-sports only.
has_decahtlon_id true Boolean parameter to display decathlon legacy sports only.

Querying a single Sport

curl "https://sports.api.decathlon.com/sports/:id"

JSON Response

{
    "data": {
        "id": "278",
        "type": "sport",
        "attributes": {
            "name": "Swimming",
            "description": null,
            "parent_id": null,
            "slug": "swimming",
            "locale": "en"
        },
        "relationships": {
            "children": {
                "data": [
                    {
                        "id": "331",
                        "type": "sport"
                    },
                    {
                        "id": "219",
                        "type": "sport"
                    },
                    {
                        "id": "405",
                        "type": "sport"
                    },
                    {
                        "id": "449",
                        "type": "sport"
                    },
                    {
                        "id": "224",
                        "type": "sport"
                    }
                ]
            }
        }
    }
}

This endpoint retrieves a sport (and its children, if any). The ID parameter can be passed in as a slug or id for convenience. In the case a sport doesn't have children, or if it's already a child, the relationship object will return null. If a sport is a child, the parent_id column will display the ID of its parent.

HTTP Request

GET https://sports.api.decathlon.com/sports/278

Query Parameters

Search query errors will be rescued with specific error messages, and an HTTP 404 status code.

Location based recommendations

curl
"https://sports.api.decathlon.com/sports/recommendations/geolocation?coordinates=-73.582,45.511&count=3"

JSON Response

[ "123", "456", "789" ]

From the coordinates, it'll find the nearest city with valid contextual data and return the most popular sports for your desired application. View the web traffic coverage

Parameter Example Description
coordinates -73,45 Longitude, latitude for the geolocation filter
count 5 Number of recommendations (Default: 3)
source popular One of : popular, decathlon, activities, places, amilia

Listing Sport Groups

curl "https://sports.api.decathlon.com/groups"

JSON response:

{
    "data": [
        {
            "id": 1,
            "type": "group",
            "attributes": {
                "name": "Water Aerobics",
                "slug": "water-aerobics",
                "locale": "en"
            },
            "relationships": {
                "sports": {
                    "data": [
                        {
                            "id": 484,
                            "type": "sport"
                        },
                        {
                            "id": 331,
                            "type": "sport"
                        },
                        {
                            "id": 219,
                            "type": "sport"
                        },
                        // ...
                    ]
                }
            }
        },
        {
            "id": 2,
            "type": "group",
            "attributes": {
                "name": "Athletics",
                "slug": "athletics",
                "locale": "en"
            },
            "relationships": {
                "sports": {
                    "data": [
                        {
                            "id": 257,
                            "type": "sport"
                        },
                        {
                            "id": 390,
                            "type": "sport"
                        },
                        // ...
                    ]
                }
            }
        },
    ]

This endpoint retrieves all sport groups and allows users to have a bird's eye view on how our sports are organized and related to one another.

HTTP Request

GET https://sports.api.decathlon.com/groups

Query Parameters

This endpoint accepts no parameters.

Querying a single group

curl "https://sports.api.decathlon.com/groups/water-aerobics"

JSON Response

{
    "data": {
        "id": 1,
        "type": "group",
        "attributes": {
            "name": "Water Aerobics",
            "slug": "water-aerobics",
            "locale": "en"
        },
        "relationships": {
            "sports": {
                "data": [
                    {
                        "id": 484,
                        "type": "sport"
                    },
                    {
                        "id": 224,
                        "type": "sport"
                    },
                    {
                        "id": 331,
                        "type": "sport"
                    },
                    {
                        "id": 385,
                        "type": "sport"
                    },
                    {
                        "id": 406,
                        "type": "sport"
                    },
                    {
                        "id": 228,
                        "type": "sport"
                    },
                    {
                        "id": 405,
                        "type": "sport"
                    },
                    {
                        "id": 221,
                        "type": "sport"
                    },
                    {
                        "id": 500,
                        "type": "sport"
                    },
                    {
                        "id": 501,
                        "type": "sport"
                    },
                    {
                        "id": 502,
                        "type": "sport"
                    },
                    {
                        "id": 503,
                        "type": "sport"
                    },
                    {
                        "id": 504,
                        "type": "sport"
                    },
                    {
                        "id": 505,
                        "type": "sport"
                    },
                    {
                        "id": 506,
                        "type": "sport"
                    },
                    {
                        "id": 219,
                        "type": "sport"
                    }
                ]
            }
        }
    }
}

This endpoint retrieves a group (and its children, if any). The ID parameter can be passed in as a slug or id for convenience. In the case a group doesn't have any children, the relationship object will return null.

HTTP Request

GET https://sports.api.decathlon.com/groups/water-aerobics

Query Parameters

Search query errors will be rescued with specific error messages, and an HTTP 404 status code.

Insipiration: https://www.flex.io/docs https://developers.cimediacloud.com/ Ideas : Run in postman : https://developer.safaricom.co.ke/docs?ruby#introduction

SDKs

Ruby

A Ruby interface to Decathlon's Sports API is available as a Ruby Gem.

Installation

Add this line to your application's Gemfile:

gem 'decathlon-sports'

And then execute:

$ bundle

Or install it yourself as:

$ gem install decathlon-sports

Usage

Decathlon::Sports.all

sports = Decathlon::Sports.all

Decathlon::Sports.find

sport = Decathlon::Sports.find(175)

Decathlon::Sports.find

sport = Decathlon::Sports.search('Snowboarding')

Decathlon::Sports::Recommendations.get

recommendations = Decathlon::Sports::Recommendations.get(175)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/decathlon/sports-api-wrapper. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Specs

This API follows the JSON:API spec

i18n

Our API supports localization of the sports names. Such data can be retrieved by passing in the preferred locale in the request header, as such:

Accept-Language: fr-CA

Errors

The Sports API renders the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid - check the JSON format of your request.
401 Unauthorized -- There's a problem with your credentials.
404 Not Found -- We can't find the data you're looking for.
422 Unprocessable Entity -- There was a validation error with your request.
500 Internal Server Error -- We had a problem with our server. Try again later.

F.A.Q.

How were the sports chosen?

These sports were humanly curated by Decathlon staff with data from 40+ years of field expertise.

We do plan on expanding research on this data with the help of our community, so application developers and/or data researchers can get the most out of it.

How is it supposed to help me?

The data provided here is a result of countless hours of research and our goal is to make it easy for Sport Tech startups to get ahead by quickly having access to metrics such as popularity, density, weather-based recommendations etc...

What if a sport is missing?

Our team has worked really hard to put together an inclusive list of sports, but we know that sport modalities can differ wildly from country to country. If you can't find info about a specific sport using our API, please don't hesitate in contacting us at developers@decathlon.com

*** Sports can be searched using the q parameter. E.g.: https://sports-decathlon.herokuapp.com/sports?q=soccer**

Where can I see/download the list of sports in a readable format?

As of the time of this writing, we only support JSON, but we're open to other formats as well. Please let us know if your application requires a different format.

Contributing

Everyone is encouraged to help improve this project.

Here are some ways you can contribute:

Submit your contribution

URL: https://developers-decathlon.canny.io/sports-api

Submitting a Pull Request

  1. Fork/Clone the Repository
  2. Create a [new-feature] branch
  3. Implement your feature or bug fix.
  4. Add, commit, and push your changes.
  5. Submit a Pull Request through Github's UI. (Get in touch for access to our repository)