Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
266 lines (196 sloc) 6.35 KB
All API Requests have to be authenticated.


You can do so by providing the Authorization header (or an access_token querystring) with your token as the value.

Getting the API Token

{% hint style="info" %} Fetch token here: {% endhint %}

Code Samples

Here are some code snippets on how to add custom headers in different languages:

{% hint style="info" %} Skywarder has a NodeJS library! {% endhint %}

Endpoint URL Token
report a1234567890


curl --header "Authorization: a1234567890"
curl -X GET \ \
  -H 'Authorization: a1234567890' \


public string Get(string url)
    WebHeaderCollection headers = new WebHeaderCollection();
    headers.Add("Authorization: a1234567890");
    HttpWebRequest getRequest = (HttpWebRequest)WebRequest.Create(url);
    getRequest.Method = "GET";
    getRequest.Headers = headers;
    WebResponse apiResponse = getRequest.GetResponse();
    StreamReader reader = new StreamReader(apiResponse.GetResponseStream(), Encoding.UTF8);
    string responseString = reader.ReadToEnd();

    return responseString;

C# RestSharp

var client = new RestClient("");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "a1234567890");
IRestResponse response = client.Execute(request);


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .addHeader("Authorization", "a1234567890")

Response response = client.newCall(request).execute();

Java Unirest

HttpResponse<String> response = Unirest.get("")
  .header("Authorization", "a1234567890")

Javascript jQuery AJAX

We don’t recommend that you access the API on the client side as you will be exposing your token publicly. However, this is how you would do it with jQuery:

var settings = {
  async: true,
  crossDomain: true,
  url: "",
  method: "GET",
  headers: {
    Authorization: "a1234567890"

$.ajax(settings).done(function(response) {


const request = require("request");
request("", {
  headers: { Authorization: "a1234567890" }


$token = "a1234567890";
$opts = [
    "http" => [
        "header" => "Authorization:" . $token

$context = stream_context_create($opts);

$test = file_get_contents("", true, $context);

PHP HttpRequest


$request = new HttpRequest();

  'Authorization' => 'a1234567890'

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;

PHP pecl_http


$client = new http\Client;
$request = new http\Client\Request;

  'Authorization' => 'a1234567890'

$response = $client->getResponse();

echo $response->getBody();

Python http.client (Python 3)

import http.client

conn = http.client.HTTPConnection("")

headers = {
    'Authorization': "a1234567890",

conn.request("GET", "/v1/report?username=USERNAME&password=PASSWORD", headers=headers)

res = conn.getresponse()
data =


Python (aiohttp)

Asynchronous python using the aiohttp library.

import aiohttp
headers = {"Authorization": "a1234567890"}
url = ""
async with aiohttp.ClientSession() as session:
    async with session.get(url, headers=headers) as resp:
        data = await resp.json()

Python (requests)

Synchronous (blocking) Python using the requests library.

import aiohttp
headers = {"Authorization": "a1234567890"}
url = ""
async with aiohttp.ClientSession() as session:
    async with session.get(url, headers=headers) as resp:
        data = await resp.json()

Ruby (NET::Http)

require 'uri'
require 'net/http'

url = URI("")

http =, url.port)

request =
request["Authorization"] = 'a1234567890'

response = http.request(request)
puts response.read_body

Swift (NSURL)

import Foundation

let headers = [
  "Authorization": "a1234567890",
  "Cache-Control": "no-cache",

let request = NSMutableURLRequest(url: NSURL(string: "")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
  } else {
    let httpResponse = response as? HTTPURLResponse

You can’t perform that action at this time.