Home

Awesome

node-bird

An API for Bird Scooters

_Do you need a paid license ? https://jzarca01.github.io/contact

Usage

const Bird = require('node-bird');
const bird = new Bird({
  licenseFilePath: './license_files/file.lic', // relative path to the root of the project
  licenseFile, // if you prefer to specify the raw content of the license file
  options = {}
});

How to use options

const Bird = require('node-bird');
const bird = new Bird({
  timeout: 3000000000,
  headers: {
    'User-Agent': 'Nintendo 64',
    'Device-id': 'your_own_uuid',
    Platform: 'ios',
    'App-Version': 'the latest version'
  }
  ...whatever you need to add
});

For a cool example, see example/index.js

Log in

bird.login(email = faker.internet.email());

Verify email

bird.verifyCode(code);

Get user agreements

bird.getUserAgreement();

Accept user agreements

bird.acceptUserAgreement(uaId);

Get profile

bird.getProfile();

Update profile

bird.updateProfile(profile);

Add voucher code

bird.addVoucherCode(code);

Get Scooters Nearby

bird.getScootersNearby(latitude, longitude, radius = 500);
radius in meters;

Get Scooter by code

bird.scanScooter(scooterCode, location = { latitude, longitude });

Get Scooter details

bird.getScooterDetails(scooter);
scooter is returned by scanScooter

Set alarm for a scooter

bird.setScooterAlarm(scooter);

Set missing for a scooter

bird.setScooterMissing(scooter);

Scan scooter

bird.scanScooter(scooterCode, location = { latitude, longitude });

Get active ride

bird.getActiveRide(location = { latitude, longitude });

Ride scooter

bird.rideScooter(scooter);
scooter can be fetched from getScootersNearby array or scanScooter

Stop ride

bird.stopRide(scooter, ride);
scooter can be fetched from getScootersNearby array or scanScooter
ride is returned from rideScooter method

Get active reservation

bird.getActiveReservation(location = { latitude, longitude });

Create a reservation

const reservation = bird.createReservation(scooter);
scooter can be fetched from getScootersNearby array or scanScooter

Cancel a reservation

bird.cancelReservation(reservation);
reservation is returned from createReservation method

Get nearby parking nests

bird.getNearbyParking(
  location = { latitude, longitude },
  radius = "5000.0"
);

Get long-term rental

bird.getLongTermRental(
  location = { latitude, longitude }
);

Get private Bird

bird.getPrivateBird(limit = 20);

Get Stripe Customer

bird.getStripeCustomer();

Get Stripe key

bird.getStripeKey();

Add card to Stripe

const stripeCard = bird.createStripeCard({ cardNumber, expMonth = "09", expYear = "2020", cardCvc = "123" });

Add card registered with Stripe to account

bird.addCardFromStripe(stripeCard.id, latitude = faker.address.latitude(), longitude = faker.address.longitude();
stripeCard is defined above

Set card as default source in your Bird account

bird.setCardAsDefault(
  cardId,
  latitude = faker.address.latitude(),
  longitude = faker.address.longitude()
);

Get config by location

bird.getConfigByLocation({ latitude, longitude});