Getting started with cURL

Company Data API querying example with cURL

Request

curl --request POST \
--url 'https://api.craft.co/v1/query?=' \
--header 'content-type: application/json' \
--header 'x-craft-api-key: qfNfdijpFhbhPhA7j2ZxvtEGkfv8DftTtmTEbnWN' \
--data '{"query":"query getCompany($domain: String!) {\n\tcompany(domain: $domain) {\n\t\t locations {\n\t\t\tcity,\n\t\t\tcountry\n\t\t} \n\t}\n}","variables":{"domain":"facebook.com"},"operationName":"getCompany"}'

Please make sure to replace qfNfdijpFhbhPhA7j2ZxvtEGkfv8DftTtmTEbnWN with your unique API key.

Response

The above command returns JSON structured like this:

{
"data": {
"company": {
"locations": [
{
"city": "Tokyo",
"country": "JP"
},
{
"city": "Ottawa",
"country": "CA"
},
{
"city": "Jakarta",
"country": "ID"
},
...
]
}
}
}

Read more