Learn how to quickly get up and running with LiteAPI. Follow these steps to start making API calls in minutes.
Step 1: Sign up
- Create an account on the LiteAPI platform.
- Obtain your API key from the dashboard.
Step 2: Authentication
- Use your API key to authenticate your requests. See the Authentication section for more details.
Step 3: Making your first API call
-
Example code to fetch hotels by city:
const apiKey = 'YOUR_API_KEY'; fetch('https://api.liteapi.travel/v3.0/data/hotels?countryCode=IT&cityName=Rome', { headers: { 'X-API-Key': apiKey } }) .then(response => response.json()) .then(data => console.log(data));
import requests api_key = 'YOUR_API_KEY' url = 'https://api.liteapi.travel/v3.0/data/hotels?countryCode=IT&cityName=Rome' 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://api.liteapi.travel/v3.0/data/hotels?countryCode=IT&cityName=Rome" 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://api.liteapi.travel/v3.0/data/hotels?countryCode=IT&cityName=Rome'; $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://api.liteapi.travel/v3.0/data/hotels?countryCode=IT&cityName=Rome'; 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 Booking workflow to see all available endpoints and their functionalities.
Helpful Resources: