Rental API¶
The Rental API lets you fetch “cold” data pertaining to the rental. It contains both editorial content (title, description, pictures, etc.) and booking data (minimum duration, availabilities etc.).
URL¶
This api endpoint is accessible at /api/rentals/ via GET
Editorial content fields¶
These fields are not normalized, they should be used to display informations to the potential client. These infos might not be up to date.
categorymain_typesub_typefloorsurface(usually in square meters)optimal_person_numbermaximal_person_number(also useful for booking)nb_roomsnb_bedroomsnb_bathroomsnb_separate_toiletschildren_friendlysmoking_allowedequipments: Contains a list of string, on for each equipmentexterior_equipments: Contains a list of string, on for each exterior equipmentaccesses: Contains a list of dictionary. Each dictionary has the following keys:type,lineandstationphotos: Contains a list of dictionary. Each dictionary has the following keys:urlwhich contains the url to download the picture andtitlewhich is the title for the picture (might be empty)extra: Contains extra info specific to this instanceaddress: Contains a dictionary with the following keys:city,street,zipcode,district,countryandgeo. The values are all strings except forgeo: it’s a dictionary withlatitudeandlongitudeas keys.environments: Contains a list of string, one for each environmenttitle: Contains a dictionary where keys are languages codes (fr,enetc.) and values are the name of the rental for each languagedescription: Same as title, contains a dictionary with a description for each languageprice: Contains editorial content about this rental’s price. It can contains a dictionary with the keysminandtypeor just a value. Do not use this price to make booking.
Booking information fields¶
booking_duration_min: Minimum duration (in days) of a booking for this rentalbooking_duration_max: Maximum duration (in days) of a booking for this rentalmaximal_person_number: The maximum of guests this rental can holdavailabilities: Contains a list of availabilities for this rental. There periods are cached and might not be up to date (they are updated every 15 minutes)sub_instance_url: The base url that you will need to use for all the booking api calls. If empty, you are already using the right url.source_id: ID of the rental. Will be used for all future booking api calls.
Availabilities structure¶
Each period is a dictionary with the following keys: start, end and type. Dates use this format: YYYY-MM-DD.
The type of a period shows if the rental is available. If the type is av then the rental is available for the period. Otherwise it’s not.
The periods should be contiguous in time: period[i]['end'] == period[i+1]['start']
Example of availabilities:
[
{
"start": "1970-01-01",
"end": "2015-06-30",
"type": "un"
},
{
"start": "2015-06-30",
"end": "2015-07-02",
"type": "av"
},
{
"start": "2015-07-02",
"end": "2015-07-03",
"type": "ag"
},
{
...
},
]
Let’s see which nights are bookable based on these periods:
- Any night up until 2015-06-29: not bookable
- The night between 2015-06-29 and 2015-06-30: not bookable
- The night between 2015-06-30 and 2015-07-01: bookable
- The night between 2015-07-01 and 2015-07-02: bookable
- The night between 2015-07-02 and 2015-07-03: not bookable
Other fields¶
unavailability_api_feed: Used for internal purposesactivated: Used for internal purposescreation_date: Creation date of the model, should not be useful to youupdate_date: Update date of the model, should not be useful to youid: Internal ID of the model, should not be useful for youurl: Url of the rental on this website, should be ignored