首页 > 解决方案 > 如何从 upcdatabase.org API (Python) 中获取特定数据

问题描述

使用 requests 包,我试图访问 upcdatabase.org API,只是为了打印出返回数据的特定部分。返回的数据如下所示:

{
    "upc": "5705831011120",
    "name": "Pink highlighter",
    "alias": "Highlighter",
    "description": "It's a pink highlighter. Here's some more information as 
well.",
    "brand": "Q-CONNECT",
    "msrp": 0.99,
    "status": 200,
    "error": false
}

我试图让名称打印出来,但它似乎作为字符串返回给 python,而不是作为列表。任何帮助表示赞赏。

标签: python

解决方案


推荐阅读