Learn how to quickly get up and running with Cupid. Follow these steps to start making API calls in minutes.
Step 1: Sign up
- Book a meeting / Mani Book a demo / Ahmad contact the Cupid team to get an access to the platform.
Step 2: Authentication
- Use you API key to authenticate your requests. See the Authentication section for more details.
Step 3: Making your first API call
-
Example code to fetch hotel by hotel id:
const apiKey = 'YOUR_API_KEY'; fetch('https://content-api.cupid.travel/v3.0/property/1323412', { headers: { 'X-API-Key': apiKey } }) .then(response => response.json()) .then(data => console.log(data));
import requests api_key = 'YOUR_API_KEY' url = 'https://content-api.cupid.travel/v3.0/property/1323412' headers = { 'X-API-Key': api_key } response = requests.get(url, headers=headers) data = response.json() print(data)
package main import ( "fmt" "io/ioutil" "net/http" ) func main() { apiKey := "YOUR_API_KEY" url := "https://content-api.cupid.travel/v3.0/property/1323412" client := &http.Client{} req, err := http.NewRequest("GET", url, nil) if err != nil { fmt.Println(err) return } req.Header.Add("X-API-Key", apiKey) resp, err := client.Do(req) if err != nil { fmt.Println(err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) }
<?php $apiKey = 'YOUR_API_KEY'; $url = 'https://content-api.cupid.travel/v3.0/property/1323412'; $options = [ 'http' => [ 'header' => "X-API-Key: $apiKey\r\n" ] ]; $context = stream_context_create($options); $response = file_get_contents($url, false, $context); $data = json_decode($response, true); print_r($data); ?>
const https = require('https'); const apiKey = 'YOUR_API_KEY'; const url = 'https://content-api.cupid.travel/v3.0/property/1323412'; const options = { headers: { 'X-API-Key': apiKey } }; https.get(url, options, (res) => { let data = ''; res.on('data', (chunk) => { data += chunk; }); res.on('end', () => { console.log(JSON.parse(data)); }); }).on('error', (e) => { console.error(e); });
Step 4: Explore the API
- Browse the API Reference and Recepies to see all available endpoints and their functionalities.