首页 > 解决方案 > 查询《金融时报》时“禁止访问此 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'}

所以我按照官方说明,但得到了同样的错误:

在此处输入图像描述

标签: pythonpython-3.xapipostman

解决方案


这是因为您的 API 密钥在 Headline License 下,它只允许访问有限的端点。因此,您应该考虑购买数据挖掘许可证,以便访问更多端点,包括代码中的“获取内容”。在此处查看更多信息:https ://developer.ft.com/portal/docs-start-obtain-an-api-key


推荐阅读