An unofficial reversed engineered Glovo Client API
npm install @lynxaegon/glovo-api
- Go to: https://glovoapp.com/en
- Login
- Open developer tools
- Refresh page
- Search for XHR request refresh
- Copy refreshToken from request payload
const GlovoAPI = require("glovo-api");
/**
./tokens.json -> where to save the tokens file
refresh token is required to be present, login is not implemented!
tokens.json format:
{
"accessToken": false,
"refreshToken": ___REFRESH_TOKEN_HERE___,
"expiresAt": false
}
**/
const glovo = new GlovoAPI("./tokens.json");
const GlovoAPI = require("glovo-api");
const glovo = new GlovoAPI("./tokens.json");
glovo.getLatLngFromAddress("Bucharest", "Bulevardul Unirii 1").then((result) => {
console.log(result.lat, result.lng);
}).catch(console.error);
const GlovoAPI = require("glovo-api");
const glovo = new GlovoAPI("./tokens.json");
glovo.getLatLngFromAddress("Bucharest", "Bulevardul Unirii 1").then((result) => {
glovo.setLocation(result);
// order.id
glovo.getStore(39537)
.then(console.log)
.catch(console.error);
}).catch(console.error);
const GlovoAPI = require("glovo-api");
const glovo = new GlovoAPI("./tokens.json");
glovo.getLatLngFromAddress("Bucharest", "Bulevardul Unirii 1").then((result) => {
glovo.setLocation(result);
glovo.getStores()
.then(console.log)
.catch(console.error);
}).catch(console.error);
const GlovoAPI = require("glovo-api");
const glovo = new GlovoAPI("./tokens.json");
glovo.getLatLngFromAddress("Bucharest", "Bulevardul Unirii 1").then((result) => {
glovo.setLocation(result);
// returns last 12 orders in desceding order (first element is the last order)
glovo.getOrders()
.then(console.log)
.catch(console.error);
}).catch(console.error);
const GlovoAPI = require("glovo-api");
const glovo = new GlovoAPI("./tokens.json");
glovo.getLatLngFromAddress("Bucharest", "Bulevardul Unirii 1").then((result) => {
glovo.setLocation(result);
glovo.getOrders()
.then((orders) => {
// get last order details
// urn format: glv:order:69624914-5b79-45e8-b7e6-5f5afc9d6bcf
glovo.getOrderDetails(orders[0].urn)
.then(console.log)
.catch(console.error);
}))
.catch(console.error);
}).catch(console.error);
const GlovoAPI = require("glovo-api");
const glovo = new GlovoAPI("./tokens.json");
glovo.getLatLngFromAddress("Bucharest", "Bulevardul Unirii 1").then((result) => {
glovo.setLocation(result);
// order.id
glovo.trackOrder(12345)
.then(console.log)
.catch(console.error);
}).catch(console.error);
MIT