You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用PHP cURL请求Kaspi.kz商品接口持续返回403错误求助

问题:PHP cURL请求Kaspi.kz商品报价持续返回403错误

尝试使用PHP的cURL工具从Kaspi.kz在线商店获取特定商品的报价信息,但始终收到403错误。目标商品页面加载后会向https://kaspi.kz/yml/offer-view/offers/100409201发起POST请求,相关PHP代码如下:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://kaspi.kz/yml/offer-view/offers/100409201');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"cityId":"750000000","id":"100409201","merchantUID":"","limit":5,"page":0,"sort":true,"product":{"brand":"IKEA","categoryCodes":["Kitchen storage containers","Food storage containers","Kitchenware","Home","Categories"],"baseProductCodes":[],"groups":[]},"zoneId":"Magnum_ZONE1","installationId":"-1"}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');

$headers = array();
$headers[] = 'Accept: application/json, text/*';
$headers[] = 'Accept-Language: ru-RU,ru;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6';
$headers[] = 'Cache-Control: no-cache';
$headers[] = 'Connection: keep-alive';
$headers[] = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$info = curl_getinfo($ch);
if (curl_errno($ch)) {
    die(json_encode([
        'status' => 0,
        'text' => curl_error($ch)
    ]));
}
curl_close($ch);

此外,还尝试过从浏览器复制cURL命令并转换为PHP代码,但该方法也未奏效。目标商品页面地址为:https://kaspi.kz/shop/p/ikea-banka-raitan-30372471-steklo-100409201/?c=750000000#!/item


内容的提问来源于stack exchange,提问作者Гани Шахмурат

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 05:50:21