iTunes中搜索JSON API返回403禁止服务器 [英] iTunes search JSON API returning 403 forbidden on server

查看:506
本文介绍了iTunes中搜索JSON API返回403禁止服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关六周左右的时间,我们已经能够执行对iTunes搜索JSON API查询没有问题。从本周开始,我们开始看到一定数量的请求(约1000 - 2K)后,403错误。我们假设这是一个限速的问题,也许他们实施新政策。有没有我们可以俯瞰另一种解释?

For the six weeks or so, we have been able to execute queries against the iTunes search JSON API without issue. Starting this week, we started to see 403 errors after a certain number of requests (about 1K - 2K). We're assuming this is a rate-limiting issue, perhaps a new policy they implemented. Is there another explanation we're overlooking?

推荐答案

当你正在寻找获得价格和评分我的猜测是,你正在做一个查找,不是搜索,与iTunes的搜索API。

As you are looking to get price and ratings my guess is that you are doing a lookup, not a search, with the iTunes Search API.

如果这个假设是真的,那么你通过他们用逗号分隔在查询中列出多个ADAM IDS可以批量查找请求。

If that assumption is true then you can "batch" lookup requests by listing multiple ADAM IDs in a query by separating them with a comma.

如。为了得到结果无论是在美国,这些应用程序 -

eg. To get results for both of these apps in the US --

<一个href=\"https://itunes.apple.com/us/app/9-innings-2013-pro-baseball/id530061728?mt=8\">https://itunes.apple.com/us/app/9-innings-2013-pro-baseball/id530061728?mt=8

<一个href=\"https://itunes.apple.com/us/app/homerun-battle-2-free/id491221570?mt=8\">https://itunes.apple.com/us/app/homerun-battle-2-free/id491221570?mt=8

- 你应该这样做:
<一href=\"https://itunes.apple.com/us/lookup?id=491221570,530061728\">https://itunes.apple.com/us/lookup?id=491221570,530061728

-- you'd do this: https://itunes.apple.com/us/lookup?id=491221570,530061728

我相信,限制每个查询50的ID。

I believe the limit is 50 ids per query.

如果有约900K的应用程序,目前居住在App Store ,一些快速数学运算表明,配料之前,如果您均匀ş$ p $垫了你的要求,你会做〜625查询/分钟。 (900K / 24小时/60分钟== 625)

If there are approximately 900K apps currently live in the App Store, some quick math shows that before batching, if you evenly spread out your requests you'd be doing ~625 queries / minute. (900K / 24 hours / 60 minutes == 625)

不过,如果你批量他们在50组,那么你在寻找大约13查询/分钟
(900K / 50%的请求/ 24小时/60分钟== 12.5)。这应该允许的范围内很好。

However, if you batch them in groups of 50 then you are looking at about 13 queries / minute (900K / 50 per request / 24 hours / 60 minutes == 12.5). This should be well within the allowed limit.

... // @ Crashalot - 如果你是做应用程序的建议,那么我们应该谈谈。

...@Crashalot - if you are doing app recommendations, then we should talk.

这篇关于iTunes中搜索JSON API返回403禁止服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆