Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/323.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 通过在标头中传递访问权限和密钥进行API身份验证时出错_Python_Api - Fatal编程技术网

Python 通过在标头中传递访问权限和密钥进行API身份验证时出错

Python 通过在标头中传递访问权限和密钥进行API身份验证时出错,python,api,Python,Api,我正在尝试使用API密钥和密码进行身份验证,但它显示403错误。下面是代码 headers = {'X-API-KEY': 'someapikey', 'X-API-SECRET': 'somesecretkey'} url="http://ops.epo.org/rest-services/publisheddata/publication/epodoc/EP1000000/fulltext" r = requests.get(url, headers=headers) 错误消息是: b'&

我正在尝试使用API密钥和密码进行身份验证,但它显示403错误。下面是代码

headers = {'X-API-KEY': 'someapikey', 'X-API-SECRET': 'somesecretkey'}
url="http://ops.epo.org/rest-services/publisheddata/publication/epodoc/EP1000000/fulltext"
r = requests.get(url, headers=headers)
错误消息是:

b'<error><code>403</code><message>This request has been rejected due to the
 violation of Fair Use policy</message><moreInfo>http://www.epo.org/searching
/free/espacenet/fair-use.html</moreInfo>\n\t\t\t\t</error>\n\t\t\t'

请帮忙

您的头没有问题,您发送了太多请求,并被临时禁止。您必须等待一段时间,然后再试一次。合理使用政策的正确链接是


读取“自动查询”部分并考虑在脚本中添加一些节流。

我正在尝试。但上面说我每周可以做4Gb。@PankajGarg你可以通过电子邮件与他们联系,也许他们会非常感谢你。我将尝试使用RESTAPI并阅读有关节流的内容。我对这一点还不熟悉。基本的节流只需在请求之间调用time.sleep()