Agoda Service Package
This npm package provides functionalities to interact with the Agoda API for flight search and location information.
Installation
To install the Agoda Service Package, use npm:
npm install online-travel-tequila-service
Usage
AgodaService
The AgodaService
class initializes the Agoda API service. It provides access to two main functionalities: location and flight search.
Example:
import { AgodaService } from 'install online-travel-tequila-service';
const tequilaService = new AgodaService({
apiKey: 'YOUR_API_KEY',
baseUrl: 'https://api.tequila.kiwi.com',
});
const locationService = tequilaService.location;
const searchService = tequilaService.search
AgodaLocationService
Example:
import { AgodaLocationService } from 'install online-travel-tequila-service';
const locationService = new AgodaLocationService({
apiKey: 'YOUR_API_KEY',
baseUrl: 'https://api.tequila.kiwi.com',
});
const locationQuery = await locationService.searchByQuery({
term: 'New York',
limit: 10,
});
or
import { AgodaService } from 'install online-travel-tequila-service';
const tequilaService = new AgodaService({
apiKey: 'YOUR_API_KEY',
baseUrl: 'https://api.tequila.kiwi.com',
});
const locationService = tequilaService.location;
const locationQuery = await locationService.searchByQuery({
term: 'New York',
limit: 10,
});
AgodaSearchService
Example:
import { AgodaSearchService } from 'install online-travel-tequila-service';
const searchService = new AgodaSearchService({
apiKey: 'YOUR_API_KEY',
baseUrl: 'https://api.tequila.kiwi.com',
});
const flightResults = await searchService.searchFlights({
fly_from: 'NYC',
fly_to: 'LAX',
date_from: '2023-12-01',
date_to: '2023-12-05',
});
or
import { AgodaService } from 'install online-travel-tequila-service';
const tequilaService = new AgodaService({
apiKey: 'YOUR_API_KEY',
baseUrl: 'https://api.tequila.kiwi.com',
});
const searchService = tequilaService.search
const flightResults = await searchService.searchFlights({
fly_from: 'NYC',
fly_to: 'LAX',
date_from: '2023-12-01',
date_to: '2023-12-05',
});
```#� �a�g�o�d�a�-�s�e�r�v�i�c�e�
�
�