11

我运行 IMDbAPI.com 并一直使用 Bing 的搜索 API 从标题搜索中查找 IMDb ID。Bing 目前正在将其 API 更改为 Azure 市场(8 月 1 日),并且不再免费提供。我开始使用 Freebase 测试我的 API 来解析这些 ID,并在前 8 小时内达到了 100k 的限制(我的网站目前每天收到大约 300 万个请求,但标题搜索只有 200-300k)

这正是他们提供数据转储文件的原因,

我下载了 Film 文件夹中的大部分文件,但找不到它们存储“/authority/imdb/title”imdb id 命名空间数据的位置。

https://www.googleapis.com/freebase/v1/mqlread?query={"type":"/film/film","name":"True%20Grit","imdb_id":null,"initial_release_date>= ":"1969-01","limit":1}

这就是我当前访问 ID 的方式。

有谁知道哪个文件包含这些信息?以及如何从电影标题/ ID 链接回它?

4

2 回答 2

7

That imdb_id property is backed by a key in the /authority/imdb/title namespace, so you're looking for the line:

/m/015gxt       /type/object/key        /authority/imdb/title   tt0065126

in the file http://download.freebase.com/datadumps/latest/freebase-datadump-quadruples.tsv.bz2

That's a 4 GB file, so be prepared to wait a little while for the download. Note that everything is keyed by MID, so you'll need to figure that out first if you don't have it in your database.

The equivalent query using MQL instead of the data dumps is https://www.googleapis.com/freebase/v1/mqlread?query=%7B%22type%22%3a%22/film/film%22,%22name%22%3a%22True%20Grit%22,%22imdb_id%22%3anull,%22initial_release_date%3E=%22%3a%221969-01%22,%22mid%22:null,%22key%22:[{%22namespace%22:%22/authority/imdb/title%22}],%22limit%22:1%7D&indent=1

EDIT: p.s. I'm pretty sure the files in the Browse directory are going away, so I wouldn't depend on them even if you could find the info there.

于 2012-07-15T15:02:31.277 回答
0

The previous answer works fine, it's just that a snappier version of such a query could be:

query = [{
          'type': '/film/film',
          'name': 'prometheus',
          'imdb_id': null,
          ...
        }];

The rest of the MQL request isn't mentionned as it doesn't differ from the aforementioned. Hope that helps.

于 2014-01-28T21:55:18.827 回答