Skip to content

Latest commit

 

History

History
94 lines (68 loc) · 2.17 KB

06-sport_filters.md

File metadata and controls

94 lines (68 loc) · 2.17 KB

Sport Filters

Introduction

A filter is associated with a sport place's activity. As opposed to tags which are boolean, their value must be either numerical, or one of the pre-defined string values.

Ex: How long is this kayaking track? becomes What is the value of the distance filter?

List of available filters

Each filter has to be linked to a sport before being associated with a sport place's activity. Here's the full list of available filters.

Numerical filters

  • cellphone_service
  • courts (number of courts)
  • court_size
  • difficulty
  • distance (meters)
  • duration (meters)
  • elevation_gain (meters)
  • equipment
  • field_size
  • modality
  • number_holes
  • pool_size
  • quality
  • ring_size
  • rink_size
  • track_size

Filters with string values

  • age: Adults, Kids, Teenagers
  • camping_accomodation: RV, Tents
  • season: Fall, Spring, Summer, Winter
  • surface: clay, sand, etc.
  • swim_area: Beach, Lake, Open Water, Pool
  • type_of_place: club, hospital, hotel, public residence, school

The full list by sport is also available through this dashboard.

If you want new filters that aren't part of the list, please submit them to sportplacesapi@decathlon.com.

Ex: depth

Get a list of allowed filters for a sport

curl "https://sportplaces.api.decathlon.com/api/v1/sports/186/filters"

JSON response:

[
    "size",
    "quality"
]

Retrieves a list of allowed filter names for a particular sport.

HTTP Request

GET https://sportplaces.api.decathlon.com/api/v1/sports/SPORT_ID/filters

Allow a filter for a sport

curl -X POST \
  https://sportplaces.api.decathlon.com/api/v1/sports/186/filters \
  -H 'Authorization: Bearer XXXXXX' \
  -d '{"slug": "difficulty"}'

JSON response:

[
    "size",
    "quality",
    "difficulty"
]

Adds a new filter to the allowed list for a specified sport.

HTTP Request

POST https://sportplaces.api.decathlon.com/api/v1/sports/SPORT_ID/filters