NAV
shell ruby python javascript

Overview

Compile’s RESTful API gives you access to Compile’s deep intelligence on businesses in the US. To use this API, you must have a key. Please reach us at [email protected] for the access key if you are interested in exploring the data.

Endpoints

  1. LIST: Generate a list of organizations based on filter parameters. Returns basic firmographic data. (eg /organization/organizations/?hq_state=California will return organizations with an HQ in California)
  2. DETAIL: Returns full profile of an organization, including advanced firmographics, company trends, IT profile and alerts (eg., the /organization/alerts/<pk> endpoint will fetch you the events for a particular Organization)

Request fields

Pagination

We provide 10 results per API call. Use the page param to fetch more. https://v1.compileapi.com/organization/organizations/?hq_state=California&page=2 will fetch you results 11-20 of Organizations in California

Examples

  1. Get all organizations in California with an employee size of 100K+ https://v1.compileapi.com/organization/organizations/?hq_state=California&employee_range=100K+
  2. Sort this list by revenue in decreasing order https://v1.compileapi.com/organization/organizations/?hq_state=California&employee_range=100K+&order=-revenue_count
  3. Search for Walmart https://v1.compileapi.com/organization/organizations/?query=walmart
  4. Get all alerts for Walmart (id 344677) https://v1.compileapi.com/organization/alerts/344677/

Authentication

To authorize, use this code:

curl -X GET -H "apikey: compileapikey"\
     "https://v1.compileapi.com/<endpoint>/"
import requests

url = "https://v1.compileapi.com/<endpoint>/"
headers = {'apikey': "compileapikey"}

response = requests.request("GET", url, headers=headers)
print(response.text)
require 'uri'
require 'net/http'

url = URI("https://v1.compileapi.com/<endpoint>/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["apikey"] = 'compileapikey'

response = http.request(request)
puts response.read_body
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://v1.compileapi.com/<endpoint>");
xhr.setRequestHeader("apikey", "compileapikey");
xhr.send(data);

Make sure to replace compileapikey with your API key.

For clients to authenticate, the token key should be included in an apikey HTTP header or as part of the url query string. For example:

apikey: compileapikey
or
https://v1.compileapi.com/<endpoint>/?apikey=compileapikey

Organization

Listing

Sample code

curl -X GET -H "apikey: compileapikey" \
     "https://v1.compileapi.com/organization/organizations/"
import requests

url = "https://v1.compileapi.com/organization/organizations/"
headers = {'apikey': "compileapikey"}

response = requests.request("GET", url, headers=headers)
print(response.text)
require 'uri'
require 'net/http'

url = URI("https://v1.compileapi.com/organization/organizations/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["apikey"] = 'compileapikey'

response = http.request(request)
puts response.read_body
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://v1.compileapi.com/organization/organizations/");
xhr.setRequestHeader("apikey", "compileapikey");
xhr.send(data);

This endpoint returns JSON structured like this:

{
    "count":169597,
    "previous":null,
    "results":[
        {
            "sector":"commercial",
            "hq_country":"United States",
            "hq_location":"Bentonville",
            "revenue_range":"10B+",
            "student_count":null,
            "name":"Wal-Mart Stores Inc",
            "revenue_count":482130000000,
            "primary_industry":"Retail",
            "hq_postal_code":"72716",
            "median_income_count":null,
            "employee_range":"100K+",
            "tuition_count":null,
            "hq_state":"Arkansas",
            "population_count":null,
            "budget_count":null,
            "website_domain":"http://walmart.com",
            "employee_count":2200000,
            "teacher_count":null,
            "id":344677
        },
        {
            "sector":"commercial",
            "hq_country":"United States",
            "hq_location":"Louisville",
            "revenue_range":"10B+",
            "student_count":null,
            "name":"Yum! Brands, Inc.",
            "revenue_count":13105000000,
            "primary_industry":"Retail",
            "hq_postal_code":"40213",
            "median_income_count":null,
            "employee_range":"100K+",
            "tuition_count":null,
            "hq_state":"Kentucky",
            "population_count":null,
            "budget_count":null,
            "website_domain":"http://yum.com",
            "employee_count":505000,
            "teacher_count":null,
            "id":339099
        },
        {
            "sector":"commercial",
            "hq_country":"United States",
            "hq_location":"Deerfield",
            "revenue_range":"10B+",
            "student_count":null,
            "name":"Walgreens Boots Alliance Inc.",
            "revenue_count":103440000000,
            "primary_industry":"Healthcare, Pharmaceuticals, & Biotech",
            "hq_postal_code":"60015",
            "median_income_count":null,
            "employee_range":"100K+",
            "tuition_count":null,
            "hq_state":"Illinois",
            "population_count":null,
            "budget_count":null,
            "website_domain":"http://www.walgreensbootsalliance.com",
            "employee_count":475000,
            "teacher_count":null,
            "id":594848
        }
    ],
    "next":"https://v1.compileapi.com/organization/organizations/?page=2"
}

This endpoint returns a set of organizations based on your query parameters. You can filter companies based on firmographic criteria (e.g. location, employee range, state etc.) or particular types of events (companies that have raised funds, companies that have won a federal contract etc.).

The results include basic profiling data on the organizations that match the criteria. Note that all the return fields will not be applicable to every organization. For instance, if an organization is of sector “commercial”, the values under tuition_count and population_count will be empty. These will only be included for educational institutions and local government bodies respectively. The “id” attached to an organization will be used for more detailed queries.

HTTP Request

GET /organization/organizations/

URL Parameters

Field action Field name Field Type Choices
ORDERING order Choices
SEARCH query
FILTER name String
FILTER website String
FILTER employee_range String (Choice) Choices
FILTER revenue_range String (Choice) Choices
FILTER primary_industry String (Choice) Choices
FILTER sector String (Choice) Choices
FILTER has_officeexpansion Boolean (1 for Yes, 0 for No)
FILTER has_vulnerability Boolean (1 for Yes, 0 for No)
FILTER has_violation Boolean (1 for Yes, 0 for No)
FILTER has_employmentchange Boolean (1 for Yes, 0 for No)
FILTER has_securitybreach Boolean (1 for Yes, 0 for No)
FILTER has_mna Boolean (1 for Yes, 0 for No)
FILTER has_executivechange Boolean (1 for Yes, 0 for No)
FILTER has_funding Boolean (1 for Yes, 0 for No)
FILTER has_federalcontract Boolean (1 for Yes, 0 for No)
FILTER has_federalgrant Boolean (1 for Yes, 0 for No)
FILTER hq_state String (Choice) Choices

order choices

ASC DESC
employee_count -employee_count
revenue_count -revenue_count
student_count -student_count
tuition_count -tuition_count
budget_count -budget_count
median_income_count -median_income_count

Filter choices

employee_range

Verbose Value
0-25 0-25
26-100 26-100
101-250 101-250
251-1K 251-1K
1001-10K 1001-10K
10001-50K 10001-50K
50001-100K 50001-100K
100K+ 100K+

revenue_range

Verbose Value
<0 <0
0-1M 0-1M
1M-10M 1M-10M
10M-50M 10M-50M
50M-100M 50M-100M
100M-250M 100M-250M
250M-500M 250M-500M
500M-1B 500M-1B
1B-5B 1B-5B
5B-10B 5B-10B
10B+ 10B+

primary_industry

Verbose Value
Agriculture & Mining Agriculture & Mining
Business Services Business Services
Computers & Electronics Computers & Electronics
Consumer Services Consumer Services
Education Education
Energy & Utilities Energy & Utilities
Financial Services Financial Services
Government Government
Healthcare, Pharmaceuticals, & Biotech Healthcare, Pharmaceuticals, & Biotech
Manufacturing Manufacturing
Media & Entertainment Media & Entertainment
Non-Profit Non-Profit
Other Other
Real Estate & Construction Real Estate & Construction
Retail Retail
Software & Internet Software & Internet
Telecommunications Telecommunications
Transportation & Storage Transportation & Storage
Travel, Recreation, and Leisure Travel, Recreation, and Leisure
Wholesale & Distribution Wholesale & Distribution

sector

Verbose Value
Commercial commercial
Education education
Government government

hq_state

Verbose Value
Alabama Alabama
Alaska Alaska
Arizona Arizona
Arkansas Arkansas
California California
Colorado Colorado
Connecticut Connecticut
Delaware Delaware
Florida Florida
Georgia Georgia
Hawaii Hawaii
Idaho Idaho
Illinois Illinois
Indiana Indiana
Iowa Iowa
Kansas Kansas
Kentucky Kentucky
Louisiana Louisiana
Maine Maine
Maryland Maryland
Massachusetts Massachusetts
Michigan Michigan
Minnesota Minnesota
Mississippi Mississippi
Missouri Missouri
Montana Montana
Nebraska Nebraska
Nevada Nevada
New Hampshire New Hampshire
New Jersey New Jersey
New Mexico New Mexico
New York New York
North Carolina North Carolina
North Dakota North Dakota
Ohio Ohio
Oklahoma Oklahoma
Oregon Oregon
Pennsylvania Pennsylvania
Rhode Island Rhode Island
South Carolina South Carolina
South Dakota South Dakota
Tennessee Tennessee
Texas Texas
Utah Utah
Vermont Vermont
Virginia Virginia
Washington Washington
Washington, D.C. Washington, D.C.
West Virginia West Virginia
Wisconsin Wisconsin
Wyoming Wyoming

Details

Sample code

curl -X GET -H "apikey: compileapikey" \
     "https://v1.compileapi.com/organization/detail/<pk>/"
import requests

url = "https://v1.compileapi.com/organization/detail/<pk>/"
headers = {'apikey': "compileapikey"}

response = requests.request("GET", url, headers=headers)
print(response.text)
require 'uri'
require 'net/http'

url = URI("https://v1.compileapi.com/organization/detail/<pk>/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["apikey"] = 'compileapikey'

response = http.request(request)
puts response.read_body
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://v1.compileapi.com/organization/detail/<pk>/");
xhr.setRequestHeader("apikey", "compileapikey");
xhr.send(data);

This endpoint returns JSON structured like this:

{
    "sector":"commercial",
    "naics_codes":[
        {
            "code":"4529",
            "name":"Other General Merchandise Stores"
        }
    ],
    "hq_postal_code":"72716",
    "employee_range":"100K+",
    "trends":{
        "Job Posts":[
            [
                "2016 Q2",
                {
                    "total":8149
                },
                {
                    "department_wise":[
                        {
                            "department":"Arts, Design, Entertainment, Sports, and Media",
                            "value":11
                        },
                        {
                            "department":"Computer and Information Technology",
                            "value":275
                        },
                        {
                            "department":"Finance and Business Operations",
                            "value":245
                        },
                        {
                            "department":"Food, Hotel and Travel Service",
                            "value":13
                        },
                        {
                            "department":"Human Resources",
                            "value":47
                        },
                        {
                            "department":"Healthcare Support",
                            "value":477
                        },
                        {
                            "department":"Installation, Maintenance, and Repair",
                            "value":303
                        },
                        {
                            "department":"Transportation, Material Moving and Warehousing",
                            "value":931
                        }
                    ]
                }
            ],
            [
                "2016 Q1",
                {
                    "total":18029
                },
                {
                    "department_wise":[
                        {
                            "department":"Arts, Design, Entertainment, Sports, and Media",
                            "value":20
                        },
                        {
                            "department":"Architecture, Engineering and Research",
                            "value":64
                        },
                        {
                            "department":"Construction, Building, Grounds Cleaning and Maintenance",
                            "value":40
                        },
                        {
                            "department":"Computer and Information Technology",
                            "value":673
                        },
                        {
                            "department":"Education, Training, and Library",
                            "value":345
                        },
                        {
                            "department":"Finance and Business Operations",
                            "value":608
                        },
                        {
                            "department":"Human Resources",
                            "value":103
                        },
                        {
                            "department":"Healthcare Support",
                            "value":1516
                        },
                        {
                            "department":"Installation, Maintenance, and Repair",
                            "value":798
                        },
                        {
                            "department":"Production",
                            "value":493
                        },
                        {
                            "department":"Sales and Marketing",
                            "value":360
                        },
                        {
                            "department":"Transportation, Material Moving and Warehousing",
                            "value":1861
                        }
                    ]
                }
            ],
            [
                "2015 Q4",
                {
                    "total":13556
                },
                {
                    "department_wise":[
                        {
                            "department":"Computer and Information Technology",
                            "value":277
                        },
                        {
                            "department":"Education, Training, and Library",
                            "value":427
                        },
                        {
                            "department":"Finance and Business Operations",
                            "value":447
                        },
                        {
                            "department":"Healthcare Support",
                            "value":891
                        },
                        {
                            "department":"Installation, Maintenance, and Repair",
                            "value":911
                        },
                        {
                            "department":"Management",
                            "value":176
                        },
                        {
                            "department":"Office, Administrative, and Customer Support",
                            "value":227
                        },
                        {
                            "department":"Production",
                            "value":320
                        },
                        {
                            "department":"Sales and Marketing",
                            "value":152
                        },
                        {
                            "department":"Transportation, Material Moving and Warehousing",
                            "value":1462
                        }
                    ]
                }
            ]
        ],
        "H1B Applications":[
            [
                "2012",
                {
                    "total":2
                }
            ]
        ],
        "Patent or Trademark Applications":[
            [
                "2016 Q2",
                {
                    "total":69
                }
            ],
            [
                "2016 Q1",
                {
                    "total":102
                }
            ],
            [
                "2015 Q4",
                {
                    "total":140
                }
            ]
        ]
    },
    "teacher_range":null,
    "website_domain":"http://walmart.com",
    "phone_numbers":[
        {
            "phone":"+1 479-273-4000",
            "type":"ph"
        }
    ],
    "revenue_range":"10B+",
    "student_count":null,
    "tuition_count":null,
    "primary_industry":"Retail",
    "stock_symbols":[
        "NYSE:WMT"
    ],
    "median_income_count":null,
    "budget_range":null,
    "wikipedia_url":null,
    "budget_count":null,
    "employee_count":2200000,
    "population_range":null,
    "twitter_url":"http://twitter.com/Walmart",
    "facebook_url":"http://www.facebook.com/walmart",
    "hq_location":"Bentonville",
    "population_count":null,
    "address":"702 Southwest 8th St, Bentonville, Arkansas, 72716, United States",
    "tuition_range":null,
    "it_budget":"21936145000",
    "student_range":null,
    "hq_country":"United States",
    "peers":[
        {
            "website_domain":"http://www.toysrus.com",
            "id":339859,
            "name":"ToysRUs"
        },
        {
            "website_domain":"http://target.com",
            "id":341856,
            "name":"Target Corp"
        },
        {
            "website_domain":"http://bestbuy.com",
            "id":342706,
            "name":"Best Buy Co., Inc."
        },
        {
            "website_domain":"http://costco.com",
            "id":343388,
            "name":"Costco Wholesale Corp"
        },
        {
            "website_domain":"www.kmart.com",
            "id":632502,
            "name":"Kmart"
        },
        {
            "website_domain":"http://www.sears.com",
            "id":635399,
            "name":"Sears"
        }
    ],
    "hq_state":"Arkansas",
    "name":"Wal-Mart Stores Inc",
    "revenue_count":482130000000,
    "identifiers":[
        {
            "identifier":"",
            "type":""
        },
        {
            "identifier":"0000104169",
            "type":"cik"
        },
        {
            "identifier":"710415188",
            "type":"ein"
        }
    ],
    "linkedin_url":"https://www.linkedin.com/company/walmart",
    "installs_summary":{
        "top_vendors":[
            "Oracle",
            "IBM",
            "SAP",
            "Microsoft",
            "BMC Software"
        ],
        "total":237,
        "verified":237
    },
    "teacher_count":null
}

This endpoint returns all the profiling information associated with an organization. These include:

HTTP Request

GET /organization/detail/<pk>/

Technology installs

Sample code

curl -X GET -H "apikey: compileapikey" \
     "https://v1.compileapi.com/organization/installs/<pk>/"
import requests

url = "https://v1.compileapi.com/organization/installs/<pk>/"
headers = {'apikey': "compileapikey"}

response = requests.request("GET", url, headers=headers)
print(response.text)
require 'uri'
require 'net/http'

url = URI("https://v1.compileapi.com/organization/installs/<pk>/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["apikey"] = 'compileapikey'

response = http.request(request)
puts response.read_body
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://v1.compileapi.com/organization/installs/<pk>/");
xhr.setRequestHeader("apikey", "compileapikey");
xhr.send(data);

This endpoint returns JSON structured like this:

[
    {
        "vendor":"Wix.com, Inc",
        "name":"Wix",
        "product_category":"Content Management",
        "install_date":"2011",
        "product_subcategory":"Enterprise Content Management (ECM)",
        "version":"",
        "is_verified":true
    },
    {
        "vendor":"RocketFuel",
        "name":"RocketFuel",
        "product_category":"Marketing Management",
        "install_date":"2016",
        "product_subcategory":"Marketing Automation",
        "version":"",
        "is_verified":true
    },
    {
        "vendor":"SumTotal Systems, Inc.",
        "name":"SumTotal",
        "product_category":"Enterprise Operations",
        "install_date":"2011",
        "product_subcategory":"Human Capital Management (HCM)",
        "version":"",
        "is_verified":true
    }
]

This endpoint gives detailed information on the technology products used in an organization. This includes the vendor name, product and version (where available). The I.T. products tracked include both webfacing technology (inferred from a businesses website) as well as technologies that reside behind the firewall and aren’t easily discernible.

HTTP Request

GET /organization/installs/<pk>/

Alerts

Sample code

curl -X GET -H "apikey: compileapikey" \
     "https://v1.compileapi.com/organization/alerts/<pk>/"
import requests

url = "https://v1.compileapi.com/organization/alerts/<pk>/"
headers = {'apikey': "compileapikey"}

response = requests.request("GET", url, headers=headers)
print(response.text)
require 'uri'
require 'net/http'

url = URI("https://v1.compileapi.com/organization/alerts/<pk>/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["apikey"] = 'compileapikey'

response = http.request(request)
puts response.read_body
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://v1.compileapi.com/organization/alerts/<pk>/");
xhr.setRequestHeader("apikey", "compileapikey");
xhr.send(data);

This endpoint returns JSON structured like this:

[
    {
        "alert_type":"mna",
        "deal_size":"",
        "acquiree":{
            "website_domain":null,
            "id":null,
            "name":"Jet.com, Inc."
        },
        "source_url":"http://feeds.reuters.com/~r/reuters/mergersNews/~3/4QWPN5tvbW8/idUSFWN1AK11U",
        "snippet":"Wal Mart in talks to buy web retailer Jet.com",
        "deal_type":"Acquisition",
        "date_of_report":"2016-08-03",
        "acquirer":{
            "website_domain":"http://walmart.com",
            "id":344677,
            "name":"Wal-Mart Stores Inc"
        }
    },
    {
        "alert_type":"executivechange",
        "current_org_id":344677,
        "previous_org_id":344677,
        "linkedin_url":"",
        "source_url":"http://feeds.businesswire.com/click.phdo?i=b1a5036ce95a82bdd7a42d7ca8d4bccf",
        "snippet":"Neustar, Inc. (NYSE: NSR), a trusted, neutral provider of real-time information services, today announced that data science expert Venkat Achanta has been appointed Chief Data and Analytics Officer.",
        "name_of_execuitive":"Venkat Achanta",
        "department":"Management",
        "role_text":"Chief Data and Analytics Officer",
        "date_of_report":"2016-07-13"
    },
    {
        "penalty":null,
        "alert_type":"violation",
        "state_name":"Minnesota",
        "penalty_amount":null,
        "alert_class":"Violation",
        "enforcement_date":"2016-07-13",
        "snippet":"Wal-Mart Stores Inc has been charged by Occupational Safety & Health Administration on 2016-07-13",
        "agency_name":"Occupational Safety & Health Administration",
        "city_name":"Grand Rapids",
        "event_date":null,
        "date_of_report":"2016-07-13"
    }
]

This endpoint gives structured alerts on an entity that are categorized by major event types. Every alert includes an one-line summary along with the date and source (where available).

For each of the type of alert_type the following fields are applicable

Employment changes employmentchange

Executive changes executivechange

Federal contracts federalcontract

Federal grants & loans federalgrant

Fund raisings fundraising

Merger, acquisition & divestitures mna

Office expansions officeexpansion

Other events otherevents

Security breaches securitybreach

Violations violation

Technology vulnerabilities vulnerability

HTTP Request

GET /organization/alerts/<pk>/

SEC filings

Sample code

curl -X GET -H "apikey: compileapikey" \
     "https://v1.compileapi.com/organization/filings/<pk>/"
import requests

url = "https://v1.compileapi.com/organization/filings/<pk>/"
headers = {'apikey': "compileapikey"}

response = requests.request("GET", url, headers=headers)
print(response.text)
require 'uri'
require 'net/http'

url = URI("https://v1.compileapi.com/organization/filings/<pk>/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["apikey"] = 'compileapikey'

response = http.request(request)
puts response.read_body
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://v1.compileapi.com/organization/filings/<pk>/");
xhr.setRequestHeader("apikey", "compileapikey");
xhr.send(data);

This endpoint returns JSON structured like this:

{
    "count":1,
    "previous":null,
    "results":[
        {
            "form":"8-K",
            "cik":104169,
            "filing_url":"https://www.sec.gov/Archives/edgar/data/104169/0000104169-16-000113-index.htm",
            "organization_id":344677,
            "filed":"2016-08-08",
            "adsh":"0000104169-16-000113"
        }
    ],
    "next":null
}

This endpoint returns the most recent SEC filings for an entity. It categorizes the major filings (e.g. annual reports, form D filings, 8-K etc) and includes the source to the filing.

HTTP Request

GET /organization/filings/<pk>/

URL Parameters

Field action Field name Field Type Choices
ORDERING order Choices
SEARCH query
FILTER organization_id Integer
FILTER form String Choices
FILTER filed String (Date YYYY-mm-dd)
FILTER filed_after String (Date YYYY-mm-dd)

order choices

ASC DESC
filed -filed

Filter choices

form

Verbose Value
10-K 10-K
10-Q 10-Q
8-K 8-K
S-1 S-1
D D
Other Other

Usage

Sample code

curl -X GET -H "apikey: compileapikey" \
     "https://v1.compileapi.com/usage/"
import requests

url = "https://v1.compileapi.com/usage/"
headers = {'apikey': "compileapikey"}

response = requests.request("GET", url, headers=headers)
print(response.text)
require 'uri'
require 'net/http'

url = URI("https://v1.compileapi.com/usage/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["apikey"] = 'compileapikey'

response = http.request(request)
puts response.read_body
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://v1.compileapi.com/usage/");
xhr.setRequestHeader("apikey", "compileapikey");
xhr.send(data);

This endpoint returns JSON structured like this:

{
    "current":{
        "usage":{
            "/organization/filings/<pk>/":1,
            "/organization/organizations/":140,
            "/organization/detail/<pk>/":8,
            "/organization/installs/<pk>/":2,
            "/organization/alerts/<pk>/":1
        },
        "window":[
            "2016-08-01",
            "2016-08-31"
        ]
    },
    "previous":{
        "usage":{
            "/organization/filings/<pk>/":0,
            "/organization/organizations/":0,
            "/organization/detail/<pk>/":0,
            "/organization/installs/<pk>/":0,
            "/organization/alerts/<pk>/":0
        },
        "window":[
            "2016-07-01",
            "2016-07-31"
        ]
    }
}

API usage current and previous billing cycle.

Returns: The total number of countable requests made to Compile API for each path

HTTP Request

GET /usage/