//initiliaze php curl
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.backlinkseo.com/v1.2/domains/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"content-type: application/x-www-form-urlencoded",
"token: [YOUR API KEY]"
)
));
$result = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
$getResponse = json_decode($result);
print_r($getResponse);
### import requests
import requests
#### post using requests
REST_HEADERS = {'Accept': 'application/json','token':'[YOUR API TOKEN]'}
getRes = requests.get(
'https://api.backlinkseo.com/v1.2/domains/',
headers=REST_HEADERS
)
getResInJSON = getRes.json()
print(getResInJSON)