The RapidAPI Developer Hub

Welcome to the RapidAPI developer hub. You'll find comprehensive guides and documentation to help you start working with RapidAPI as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Guides

Installing & Making a Request

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package, you can now create a new instance of the unirest client and form a request.

var unirest = require('unirest');

unirest.post(API_URL)
  .header("X-RapidAPI-Key", API_KEY)
  .end(function (result) {
    console.log(result.status, result.headers, result.body);
  });

Uploading Files

unirest.post(API_URL)
  .header("X-RapidAPI-Key", API_KEY)
  .header({'Content-Type': 'multipart/form-data'})
  .field('parameter', 'value') // Form field
  .attach('file', '/path/to/file') // Attachment
  .end(function (result) {
    console.log(result.status, result.headers, result.body);
  });

Unirest Functionality

A request can be initiated by invoking the appropriate method on the unirest object, then calling .end() to send the request. Alternatively, you can send the request directly by providing a callback along with the url.

GET

unirest.get(API_URL)
  .header("X-RapidAPI-Key", API_KEY)
  .end(function (result) {
    console.log(result.status, result.headers, result.body);
  });

PUT

unirest.put(API_URL)
  .header("X-RapidAPI-Key", API_KEY)
  .end(function (result) {
    console.log(result.status, result.headers, result.body);
  });

POST

unirest.post(API_URL)
  .header("X-RapidAPI-Key", API_KEY)
  .end(function (result) {
    console.log(result.status, result.headers, result.body);
  });

PATCH

unirest.patch(API_URL)
  .header("X-RapidAPI-Key", API_KEY)
  .end(function (result) {
    console.log(result.status, result.headers, result.body);
  });

DELETE

unirest.delete(API_URL)
  .header("X-RapidAPI-Key", API_KEY)
  .end(function (result) {
    console.log(result.status, result.headers, result.body);
  });

Node.js


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.