python - 查询《金融时报》时“禁止访问此 API”
问题描述
如何通过他们的 API 获取 FT 文章?
在询问了密钥后,我首先使用了一个 python API 包装器来围绕他们的内容 API,v2。所以我运行了以下内容:
from pyft import FT
ft = FT()
# the id can be pulled from the slug url of an FT.com story
content = ft.get_content("6f2ca3d6-86f5-11e4-982e-00144feabdc0")
print(content)
并得到:
{'error': 'Access to this API has been disallowed'}
所以我按照官方说明,但得到了同样的错误:
解决方案
这是因为您的 API 密钥在 Headline License 下,它只允许访问有限的端点。因此,您应该考虑购买数据挖掘许可证,以便访问更多端点,包括代码中的“获取内容”。在此处查看更多信息:https ://developer.ft.com/portal/docs-start-obtain-an-api-key
推荐阅读
- php - 如何在 WordPress 中为已注销的用户添加重定向异常
- python - 以 JSON 格式发送 OpenCV 图像
- git - 如何将 GitHub QGumboParser 库添加到 macOS 上的 Qt 项目?
- javascript - 来自屏蔽输入文本的时刻 js 无效日期
- c++ - 无法手动调用 std::string 的析构函数
- c++ - 更改常量 Mat opencv 的值
- vuejs2 - 如何为 v-treeview 添加右键单击事件以在 vuetify 中打开菜单?
- java - MapReduce 项目的 Mapper 部分中的多个错误
- functional-programming - 捕获函数组合中参数的排序特征的术语
- java - 如何处理 FileSystemAlreadyExistsException?