Getting started with cURL
Company Data API querying example with cURL

Request

1
curl --request POST \
2
--url 'https://api.craft.co/v1/query?=' \
3
--header 'content-type: application/json' \
4
--header 'x-craft-api-key: qfNfdijpFhbhPhA7j2ZxvtEGkfv8DftTtmTEbnWN' \
5
--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"}'
Copied!
Please make sure to replace qfNfdijpFhbhPhA7j2ZxvtEGkfv8DftTtmTEbnWN with your unique API key.

Response

The above command returns JSON structured like this:
1
{
2
"data": {
3
"company": {
4
"locations": [
5
{
6
"city": "Tokyo",
7
"country": "JP"
8
},
9
{
10
"city": "Ottawa",
11
"country": "CA"
12
},
13
{
14
"city": "Jakarta",
15
"country": "ID"
16
},
17
...
18
]
19
}
20
}
21
}
Copied!

Read more

Last modified 1yr ago
Copy link