I’m trying play with a website’s GraphQL API (https://www.xxxlutz.hu/api/graphql
) to scrape data. In Altair working fine, but I need to run in PHP with curl_impersonate
to bypass Cloudflare.
I tried this, and working fine:
$d = '{"query":"query {navigation(codes: ["header_nav_root"], levelAmount:2 , levelOffset:0){data}}"}';
$curl_impersonate_exec_command = '/usr/local/bin/curl_chrome100 -g -L "' . $url . '" -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d '' . $d.' '' ;
$response = shell_exec($curl_impersonate_exec_command);
echo $response;
I tried another query, but something wrong with my query string, maybe in "filters" param. I tried many ways, but I receive "bad request".
in Altair working fine, but in php curl don’t …
altair
Without filters, looks working fine, error message, "filters" missing. Ok.
$d = '{"query":"query {getSearchResults(cid: "",pagination: "{page:1,numberOfResults:60}", sortBy: "available" ) { rid }}"}';
$curl_impersonate_exec_command = '/usr/local/bin/curl_chrome100 -g -L "' . $url . '" -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d '' . $d.' '' ;
$response = shell_exec($curl_impersonate_exec_command);
echo $response;
I’m tried to add filters, but I can’t figure out the right syntax
filters: "[{"id": "categories","type": "categoryFilter","values":["C1","C1C9","C1C9C1"]}]",`
Can someone help?
New contributor