https://github.com/mathdroid/gojek-api
API client for gojek
https://github.com/mathdroid/gojek-api
Last synced: 9 months ago
JSON representation
API client for gojek
- Host: GitHub
- URL: https://github.com/mathdroid/gojek-api
- Owner: mathdroid
- Created: 2017-04-04T21:11:56.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-05T08:17:27.000Z (almost 9 years ago)
- Last Synced: 2025-04-20T06:34:55.193Z (10 months ago)
- Language: JavaScript
- Size: 36.1 KB
- Stars: 53
- Watchers: 4
- Forks: 32
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `gojek-api`
> A client for APIs used in Go-Jek application.
![Image Here]()
# Usage
```sh
npm install --save gojek-api
```
```js
const Gojek = require('gojek-api')
const KEMANG_TIMUR_RAYA = '-6.2635056,106.8236571'
async function showNearbyMotors ({location}) {
try {
const motors = await Gojek.getNearbyGojek({location})
console.log(motors)
return motors
} catch (e) {
return Promise.reject(e)
}
}
showNearbyMotors({location: KEMANG_TIMUR_RAYA})
```
# API
## `getNearbyGojek({location: String})`
Accepts a LatLng string (e.g. `'-6.2635056,106.8236571'`) as the `location`. Returns an array of Gojek bike drivers `{driverLatLong, driverVehicleType}`
`driverLatLong`: `String`
`driverVehicleType`: `'bike'`
## `getNearbyGoCar({location: String})`
Accepts a LatLng string (e.g. `'-6.2635056,106.8236571'`) as the `location`. Returns an array of Go-car drivers `{driverLatLong, driverVehicleType}`
`driverLatLong`: `String`
`driverVehicleType`: `'car'` or `'blue-bird'`
# License
MIT (c) 2017 [Muhammad Mustadi](https://github.com/mathdroid)