1.0.0 • Published 7 years ago
nitrotype v1.0.0
nitrotype.js
Client for the unofficial Nitro Type API.
Installation
$ yarn add nitrotype
# or
$ npm install nitrotype --saveUsage
The following example shows how to claim the daily reward:
const nitrotype = require('nitrotype')
const client = nitrotype({ username: '<YOUR_USERNAME_HERE>', password: '<YOUR_PASSWORD_HERE>' })
;(async () => {
await client.login()
const res = await client.get('rewards/daily')
console.log(res)
// Output: { success: true, data: { reward: true, next: 75600, type: 'money', value: 30000 } }
})()Methods
Client#get(path[, options])Client#post(path[, options])
options should be an object that contains a data object (for POST requests) and/or a params object (for URL parameters).
Endpoints
The base API url (https://nitrotype.com/api/) is automatically by the library. It will work even if you pass in just the endpoint. If you find an endpoint that isn't already documented below, please don't hesitate to open a pull request!
Achievements
GET achievementsPOST achievements/check: ids
Authentication
POST login: password, usernamePOST logoutPOST register: password, username
Cars
GET carsPOST cars/<carId>/buy: carID, passwordPOST cars/<carId>/paint: angle, carID, passwordPOST cars/<carId>/sell: carID, passwordPOST cars/<carId>/use
Friends
GET friendsPOST friends/<userId>/deletePOST friends/<userId>/requestPOST friends/<userId>/sendcash: amount, passwordGET friend-requestsPOST friend-requests/accept-allPOST friend-requests/<userId>/accept
Nitros
POST buy-nitros: password, quantityPOST sell-nitros: password, quantity
Players
POST players-search: term
Purchase
POST purchase: product, purchaseFor, purchaseForUsername
Race
GET race/<raceId>POST race/save-qualifying: carID, speed
Referrals
GET referrals
Rewards
GET rewards/daily
Scoreboard
GET scoreboard: board, grouping, seasonID, time
Settings
GET settingsPOST settings/profile: country, displayName, gender, title
Stats
GET stats/data/bymonth: limit, pageGET stats/data/lastdays: limit, pageGET stats/data/racelog: limit, pageGET stats/graphs/bymonth: limit, pageGET stats/graphs/lastdaysGET stats/graphs/racelogGET stats/summary
Teams
GET teams/applicationsPOST teams/search: invitesPOST teams/status: statusGET teams/<teamId>POST teams/<teamId>/accept-invitePOST teams/<teamId>/applyPOST team-members/<userId>/removePOST team-requests/accept-allPOST team-requests/<userId>/acceptPOST team-requests/<userId>/deny
Miscellaneous
POST lostpass-send: emailPOST support/account-help: alt_email, captchaKey, email_type, firstname, lastname, login, other, username
License
1.0.0
7 years ago