Professional Web APIs with PHP: Ebay, Google, Paypal, Amazon, Fedex Plus Web Feeds


  • Offers hands-on tips and numerous code examples that show Web developers how to leverage content and feeds from today's top Web sites-including Google, eBay, PayPal, Amazon, Yahoo!, and FedEx
  • Introduces APIs (Application Program Interfaces) in general and uses real-world examples that show how to produce and document them
  • Explains how to use the popular scripting language PHP to create APIs that interact with...
See more details below
$31.69 price
(Save 20%)$39.99 List Price
Other sellers (Paperback)
  • All (22) from $1.99   
  • New (6) from $5.00   
  • Used (16) from $1.99   
Sending request ...


  • Offers hands-on tips and numerous code examples that show Web developers how to leverage content and feeds from today's top Web sites-including Google, eBay, PayPal, Amazon, Yahoo!, and FedEx
  • Introduces APIs (Application Program Interfaces) in general and uses real-world examples that show how to produce and document them
  • Explains how to use the popular scripting language PHP to create APIs that interact with unrelated applications over the Web
  • Examples take readers through each stage of the API process, from basic test implementations to integration with existing sites
Read More Show Less

Product Details

  • ISBN-13: 9780764589546
  • Publisher: Wiley
  • Publication date: 7/31/2006
  • Series: Wrox Professional Guides Series
  • Edition number: 1
  • Pages: 384
  • Product dimensions: 7.40 (w) x 9.10 (h) x 1.00 (d)

Meet the Author

Paul Michael Reinheimer (Waterloo, Ontario, Canada) is a Zend Certified Engineer currently developing Share The Beat ( an online music portal developed extensively in PHP. Paul has extensive PHP programming experience.

Chris Shiflett (NY, NY) is a frequent contributor to the PHP community and a leading security expert. He talks at conferences such as ApacheCon and the O'Reilly Open Source Convention, and publishes articles in PHP Magazine and php|architect. "Security Corner," his monthly column for php|architect, which is the industry's foremost PHP security column.

Read More Show Less

Read an Excerpt

Professional Web APIs with PHP

eBay, Google, Paypal, Amazon, FedEx plus Web Feeds
By Paul Reinheimer

John Wiley & Sons

Copyright © 2006 John Wiley & Sons, Ltd
All right reserved.

ISBN: 978-0-7645-8954-6

Chapter One

Introducing Web Services

I imagine you picked up this book for a reason.

Perhaps you've built a fantastic website for your organization, but now that it's done, you want more: more ways to view the information, more ways to alter the information, more ways to share the information. Web services can help.

Maybe you run a small business through eBay and want better ways to manage the items you are selling. Web services can help.

You could be a student, a teacher, or an institution wanting to leverage the vast wealth of information compiled by Google. Web services can help.

Web services can help you use the information on the Web in new ways, from simply allowing someone to subscribe to pockets of information so that they can be immediately notified when new information is available, to creating complex business applications that can manage complex real-time supply chains.

Before digging in to how to use web services in the following chapters, this chapter presents you with the following:

What web services are

Why web services are used

How web services work

Who uses web services

And finally, why you should use web services

Defining Web Services

Web services are a collection of protocols that are used to exchange data between disparate applications or systems. The essence of web services is the open standards on which they are built, by leveraging public and common protocols like HTTP, along with the XML document model. Web services are easy to implement with existing technologies. Not only are you (as a PHP developer) already familiar with many aspects of web services and the tools required, but you already have the facilities required to deploy them.

Why They Are Used

Simply put, web services allow information to easily pass from those who have it to those who desire it. Both feeds and APIs allow the requestor to obtain information from the service, regardless of the information type. Web services allow customers to access the information they desire, without the extraneous information generally presented on web pages. For example, running a search for a book on will yield several relevant results, generally (under the current layout) in the center column of the page. The right and left columns will contain other information, not directly related to your search (recommended titles, recently viewed items, and so on). Performing the same search via the API will yield the same results, but without that extraneous information.

This points to a key factor in web services - they are used to obtain specific information, or complete specific tasks. Unlike people, the automated processes that utilize web services don't make impulse decisions (like choosing a recommended title from Amazon), so there is no point in presenting them with those types of options.

How They Are Used

Web services generally present information already available via another method (that is, a website). The advantage in the services is the consistent presentation of the information (in stark contrast to methods like screen scraping) in an easy-to-parse format. Here are some examples:

Federal Express - Allows customers to do rate lookups and schedule shipments after logging into its online system. These same tasks can be accomplished via its API; as such, customers with larger shipping needs can integrate the API with their own systems to quickly automate shipping, and allow customers to determine how much it will cost to ship a particular product.

Amazon - Allows customers to search for products via its website, and similar tasks can be accomplished via its API (often with more granularity than the traditional web interface provides). Using the API allows small booksellers to transparently integrate with Amazon to offer additional books and apply their own pricing.

My Personal Blog - Allows people to read my thoughts on various professional matters. The feeds provided by my blog allow those people to read the posts on their own terms, within their own client, without ads or cute pictures of my cat.

It's important to recognize both types of interaction presented here. In some cases the web service is accessed directly by the end user (as is often the case with blogs and feeds). In other cases the service is consumed by an intermediate service, then presented (through various means) to its users.

Who Uses Them

If you accept my broad definition of web services, including both feeds and APIs, the answer is almost everyone. Most news sites offer at least some of their information via an XML feed. Blog sites almost without exception include some form of feed, and APIs are becoming more prevalent offerings from businesses of all sizes.

Also keep in mind that the scope of web services varies widely depending on who offers them. Many are merely informational in nature (such as the National Weather Service API), providing read-only access to information. Others, however, allow you to present information to the server; this could be purely digital in nature (such as adding a bookmark to your account), or it could set into motion a series of physical events (like scheduling a package pickup through FedEx).

Why You Should Use Web Services

There are two main reasons to use web services, both remarkably straightforward: someone else has information you require, or you have information you wish to provide to others. When planning a new web service, remember that servers can either provide or accept information. Remember that web services can provide any level of security, from a completely open service open to all who request it, to a private service with transfers happening over SSL and client-side certificates to validate identities.

Convincing the Boss

Here are a few more tidbits that should help convince the boss (or you) that web services are a route to look into:

Web services make use of technology you already have deployed - you already have a web server, you already have a database, and so on. Why not provide another way to access the data?

Web services fit into the security scheme you are already employing. Careful deployment will keep security concerns in line with regular web access.

Technically savvy users will find a way to access the information they desire. Without web services they will need to resort to methods like screen scraping, which is more difficult to control and can be unreliable (and providing unreliable access to your information is worse than providing none at all).

Web services can help manage costs; easy integration with companies (like FedEx) that offer services to you can result in lower variable costs for your transactions.

Web services will allow your business to scale; allowing clients to integrate their systems with yours will help encourage continued relationships, and avoid devoting resources to creating systems for specific clients.


This chapter answered some basic questions about web services that should allow you to do the following:

Explain what web services are and how they work

See the value in utilizing web services in your own projects

Convince others that it's definitely worth the effort to build and use web services

In the next chapter, you start working with web feeds, a simple but useful form of web services. As you progress through the book, you'll start getting into more complex uses of web services and eventually create your own web service APIs.


Excerpted from Professional Web APIs with PHP by Paul Reinheimer Copyright © 2006 by John Wiley & Sons, Ltd. Excerpted by permission.
All rights reserved. No part of this excerpt may be reproduced or reprinted without permission in writing from the publisher.
Excerpts are provided by Dial-A-Book Inc. solely for the personal use of visitors to this web site.

Read More Show Less

Table of Contents



Part One: Web Feeds.

Chapter 1: Introducing Web Services.

Chapter 2: Introducing Web Feeds.

Chapter 3: Consuming Web Feeds.

Chapter 4: Producing Web Feeds.

Part Two: APIs.

Chapter 5: Introduction to Web APIs.

Chapter 6: Interacting with the Google API.

Chapter 7: Interacting with the Amazon API.

Chapter 8: Interacting with the FedEx API.

Chapter 9: Interacting with the eBay API.

Chapter 10: Interacting with the PayPal API.

Chapter 11: Other Major APIs.

Chapter 12: Producing Web APIs.

Appendix A: Supporting Functions.

Appendix B: Complete Feed Specifications.

Appendix C: Development System.


Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)