Company Data API Introduction
The Craft Company Data API is a GraphQL API build over HTTP and SSL.
GraphQL makes it possible to make a single API call to fetch all of the information on a particular company you need.
In order to make an API call, you need to send a POST request to the Company Data API endpoint:
1
POST https://api.craft.co/v1/query
Copied!
In order to receive the GraphQL schema, you would do a POST request:
1
POST https://api.craft.co/v1/schema
Copied!
A GraphQL POST request should use the application/json content type, have the x-craft-api-key header with your API Key in the value , and include a JSON-encoded body of the following form:
1
{
2
"query": "...",
3
"variables": { "myVariable": "someValue", ... }
4
}
Copied!
In order to receive an API key please reach out to [email protected]
Query parameters should be sent as a JSON-encoded string in an additional query parameter called variables.
query is a required String parameter of the JSON body. An example would be:
1
query getCompany($domain: String!) {
2
company(domain: $domain) {
3
locations {
4
city
5
country
6
}
7
}
8
}
Copied!
variables is a required JSON object parameter for most of the cases. An example would be:
1
{ "domain": "facebook.com" }
Copied!

Response

Regardless of the method by which the query and variables were sent, the response should be returned in the body of the request in JSON format.
A query might result in some data and some errors, and those should be returned in a JSON object of the form:
1
{
2
"data": { ... },
3
"errors": [ ... ]
4
}
Copied!
If there were no errors returned, the "errors" field will not present on the response. Check out more details on errors.
Last modified 1yr ago
Copy link
Contents
Response