如何在 PHP 中使用亚马逊的 API 来搜索书籍?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2954264/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 08:13:42  来源:igfitidea点击:

How can I use Amazon's API in PHP to search for books?

phpapiobjectamazon-web-services

提问by TerranRich

I'm working on a Facebook app for book sharing, reviewing, and recommendations. I've scoured the web, searched Google using every search phrase I could think of, but I could not find any tutorials on how to access the Amazon.com API for book information.

我正在开发一个 Facebook 应用程序,用于图书分享、评论和推荐。我在网上搜索,使用我能想到的每个搜索词组在 Google 上搜索,但我找不到任何关于如何访问 Amazon.com API 以获取书籍信息的教程。

I signed up for an AWS account, but even the tutorials on their website didn't help me one bit. They're all geared toward using cloud computing for file storage and processing, but that's not what I want.

我注册了一个 AWS 账户,但即使他们网站上的教程也没有帮助我。它们都面向使用云计算进行文件存储和处理,但这不是我想要的。

I just want to access their API to search info on books. Kind of like how http://openlibrary.org/does it, where it's a simple URL call to get information on a book (but their databases aren't nearly as populated as Amazon's).

我只想访问他们的 API 来搜索书籍信息。有点像http://openlibrary.org/是如何做到的,它是一个简单的 URL 调用来获取一本书的信息(但他们的数据库不像亚马逊那样填充)。

Why is it so hard to find the information I need on Amazon's AWS site? If anybody could help, I would greatly appreciate it.

为什么在亚马逊的 AWS 网站上很难找到我需要的信息?如果有人可以提供帮助,我将不胜感激。

采纳答案by Juan

You could let Zend Framework do the work for you using Zend_Service_Amazon. From what I see it's fairly easy to use, and for simple queries the examples should be enough.

您可以让 Zend Framework 使用Zend_Service_Amazon为您完成工作。从我看来,它相当容易使用,对于简单的查询,示例应该足够了。

回答by cabbey

The reason you weren't finding what you wanted with the AWS APIs is that AWS doesn't have anything to do with Amazon.com's shopping experience.

您没有通过 AWS API 找到您想要的东西的原因是 AWS 与 Amazon.com 的购物体验没有任何关系。

AWSis the cloud service layer that their website is built upon, which they have externalized so others can build upon it as well. As has been mentioned, you want the affiliate advertising stuff.

AWS是构建他们网站的云服务层,他们已将其外部化,以便其他人也可以在此基础上进行构建。正如已经提到的,你想要联盟广告的东西。

回答by Brent Baisley

You want to be looking at their affiliate program, which now appears to be under "advertising". As I recall, it's free to sign up and it works on a referral commission basis. There is nothing specifically for books, you would need to lookup the category ID for books, then you can query on that. There API is pretty extensive and has specific "fields" for different types of product.

您想查看他们的联盟计划,该计划现在似乎在“广告”之下。我记得,注册是免费的,而且是在推荐佣金的基础上运作的。没有专门针对书籍的内容,您需要查找书籍的类别 ID,然后您可以对其进行查询。API 非常广泛,并且针对不同类型的产品具有特定的“字段”。

https://affiliate-program.amazon.com/gp/advertising/api/detail/main.html

https://affiliate-program.amazon.com/gp/advertising/api/detail/main.html

I used the Amazon API for a Facebook app at my last job called Gift-O-Matic (terrible name), that included books from Amazon as a category. The Zend Amazon lib is a good start, but I found it too verbose and rolled my own.

我在上一份名为 Gift-O-Matic(可怕的名字)的工作中将亚马逊 API 用于 Facebook 应用程序,其中包括来自亚马逊的书籍作为一个类别。Zend Amazon lib 是一个良好的开端,但我发现它过于冗长并推出了我自己的。