通过在标头中传递访问权限和秘密密钥来进行错误API身份验证

时间:2020-02-25 07:18:46

标签: 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'<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'

请帮助!

1 个答案:

答案 0 :(得分:1)

您的标题没有问题,您发送了太多请求并被暂时禁止。您必须等待一段时间,然后重试。合理使用政策的正确链接是https://www.epo.org/service-support/ordering/fair-use.html

阅读“自动查询”部分,并考虑向脚本添加一些限制。