Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mr687/google-hotel-api
Google Hotel Unofficial API
https://github.com/mr687/google-hotel-api
api google hotel unofficial
Last synced: 27 days ago
JSON representation
Google Hotel Unofficial API
- Host: GitHub
- URL: https://github.com/mr687/google-hotel-api
- Owner: mr687
- Created: 2023-05-22T08:41:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-08T00:17:49.000Z (8 months ago)
- Last Synced: 2024-11-16T03:27:12.314Z (about 1 month ago)
- Topics: api, google, hotel, unofficial
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/google-hotel-api
- Size: 88.9 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Google Hotel Unofficial API
[![Build Status](https://travis-ci.org/mr687/google-hotel-api.svg?branch=main)](https://travis-ci.org/mr687/google-hotel-api)
[![Coverage Status](https://coveralls.io/repos/github/mr687/google-hotel-api/badge.svg?branch=main)](https://coveralls.io/github/mr687/google-hotel-api?branch=main)
[![Dependency Status](https://david-dm.org/mr687/google-hotel-api.svg)](https://david-dm.org/mr687/google-hotel-api)
[![devDependency Status](https://david-dm.org/mr687/google-hotel-api/dev-status.svg)](https://david-dm.org/mr687/google-hotel-api#info=devDependencies)
[![npm version](https://badge.fury.io/js/google-hotel-api.svg)](https://badge.fury.io/js/google-hotel-api)## Description
This is an unofficial API for Google Hotel. It is based on the [Google Hotel API](https://www.google.com/travel/hotels/). It is not affiliated with Google in any way.
## Installation
```bash
npm install google-hotel-api
```or if you prefer yarn
```bash
yarn add google-hotel-api
```## Usage
```js
const { createHotelListing } = require('./dist/index');const data = createHotelListing({
language: 'en',
})
.addHotel({
id: '123abc',
name: 'Belgrave House',
address: {
format: 'simple',
component: [
{ name: 'addr1', value: '6 Acacia Ave' },
{ name: 'addr2', value: 'Floor 5' },
{ name: 'city', value: 'London' },
{ name: 'province', value: 'Greater London' },
{ name: 'postal_code', value: 'SW1W 9TQ' },
]
},
country: 'GB',
latitude: 35.070374,
longitude: -106.213648,
phone: {
type: 'main',
value: '123-456-7890'
},
category: 'hotel',
})
.writeString();console.log(data);
``````xml
en
123abc
Belgrave House
6 Acacia Ave
Floor 5
London
Greater London
SW1W 9TQ
GB
35.070374
-106.213648
123-456-7890
hotel
```