php - PHP 使用 Instagram API 错误 HTTP 请求失败!HTTP/1.1 403 禁止
问题描述
这个网址也可以在浏览器中使用,但代码如下:
$insta_id = $ret->users[0]->user->pk;
$link1 = "https://www.instagram.com/graphql/query/?query_hash=42323d64886122307be10013ad2dcc44&variables=%7B%22id%22:%22".$insta_id."%22,%22first%22:12,%22after%22:%22AQDea0aZ27W349lmEWRcuh9xz7sO2Elo-_RDymqEMzT85he8dFwkrV4lbKlii9z7AkWPEbLx_txFKKbHeuotw9c4fY40B-Mm-lF7sfWtq8PUfQ%22%7D";
$response1 = file_get_contents($link1);
我在调用我的函数之前得到的是:
Message: file_get_contents(https://www.instagram.com/graphql/query/?query_hash=42323d64886122307be10013ad2dcc44&variables=%7B%22id%22:%22492948834%22,%22first%22:12,%22after%22:%22AQDea0aZ27W349lmEWRcuh9xz7sO2Elo-_RDymqEMzT85he8dFwkrV4lbKlii9z7AkWPEbLx_txFKKbHeuotw9c4fY40B-Mm-lF7sfWtq8PUfQ%22%7D): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
任何想法如何解决这个问题?非常感谢
解决方案
推荐阅读
- node.js - API 优先设计:MERN 堆栈 API 调用
- apache-spark - 使用 pySpark 在 RDD 中对数组类型的值进行排序
- excel - 如何查询仅连接查询
- python - How do I print out one factorial number? My code keeps printing out too many numbers and I do not know why?
- javascript - 在drawImage上使用onClick
- material-ui - 禁用MuiButton时材质ui V5更改指针
- serverless-framework - 无服务器与无服务器云
- python - PyCharm 和 Oracle 连接:访问表
- java - Java Kafka 客户端/PEM 证书/密钥:InvalidConfigurationException:java.io.IOException:ObjectIdentifier() 数据不是对象 ID(标记 = 48)
- python - 忽略以 - 或 ' 1 或更多开头的单词的正则表达式