I find the eBay website unbelievably badly designed, and have been working several hours trying to make simple, simple things work. I want to get product listings from a certain category (and if possible child categories) via XML, then parse them with PHP into a web page. I already know XML and PHP, it's getting the XML that is proving difficult. They have "shopping" tools and "trading" tools, but don't seem to explain what the differences are though I think I want shopping. But how to do this?? To do the above, what needs to happen? I did manage to get sample listings with a script I found buried in a menu there earlier, but it was a keyword search, not a category listing. Thanks, I am at my wit's end with their unexplained menus and 8-pixel fonts.
I would read this blog post titled 'Using eBay's API to search auctions and return results'. Also, you can restrict to category by adding the following: $requestXmlBody .= "<CategoryID>somecatnumber</CategoryID>"; PHP: Also, this reference is very useful as well: http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/io_GetSearchResults.html Hope this helps hanji
If you only want to search and display listings, then use the Shopping API. The Trading API is used for people who write software that helps post items for sale on ebay. With the Trading API, you can submit new items to sell, check on items that you have listed, etc.
Yeah, I finally figured that out (on my own, no thanks to eBay). I took their Shopping-half item lookup script, poked around in their documentation (which technically, I have to say, is really good), substituted and played around, came up with my own solutions, and got it working. Thanks!
I hope that you have tons of patience because you may have some surprises when and if you want to certify your API for distribution. I certainly had to adjust my code to cache as much as possible in the database. There are important differences in trading services and the shopping services. Be sure to read as much as you can to be sure that you're doing the right thing for your needs. Also, with respect to certification, the request to get categories results in an 11+MB XML file - and they don't want you to request the whole file every day (or frequently at all for that matter)... There are examples as to request based on the version that you last downloaded - I think that you just get what changed between the versions (I'd really have to dig out the code to answer this). I have all of the categories stored in a MySQL table - and the navigation is pretty quick -- if you want to check out what I mean, it is used in the ad customizer and a similar "my items" (for sellers) I created, but you can just browse the categories. http://auctionreporting.com/customizer/categories.html I'd be happy to help you wrestle the eBay developer stuff when I've got the time.
bgillingham, thanks for the good reply. You mean to store category number info, or actual listings info? I hope eBay doesn't have a problem with a niche site making a web services request on every page load to get the latest listings, since they are by nature time-sensitive. What do you mean by having an API certified for distribution? What I'm really curious about it creating a niche site based on an eBay category and its child categories. That seemed easy, I did a call for GetCategories and used the CategoryParent limiter, no problem. The listings are easy to then get, so things seem to be moving along. (The documentation for that request was in the "trader" section, though as far as I know I'm using "shopper". Honestly, I don't really understand how/why these 2 things are separate, technically speaking; the site sure didn't try very hard to explain it to me. Or it makes total sense, and for some reason there are a lot more people bidding on things from afar than I would've thought...) That's really my aim, just to list things for sale on eBay and drive customers to the site to sign up/bid/whatever. Not getting into listing items or taking bids from users, at least I have no plans now for that! Your site is really good, looks really useful. Thanks for your help!
You can do the quick math for your answer, but you should take every measure to minimize calls to the API. The last time that I checked, developer can make 1.5 Million calls in a day - so if the total calls that each page makes is only one -- you would have to have insane traffic to just violate the limit. After you exceed the limit, I am not sure what happens to the first request over the limit - does it return the reason in the error tag of the XML response? I am not sure. I know that you can arrange to buy more API calls if needed. I do store the categories and the items data in my database. I have an out-of-process CRON job that updates these items for the current prices / bids. There is a certain percentage of items that display before it's prices or bids can be updated, but that is an acceptable small percentage. This process currently ADDS to my total API calls per display, but after I get a few more clients, it will start to be more of a 1::1 relationship. Another benefit of pulling my items from the database is that they load a lot faster than an XML response. I plan to use the cached data for other services as well - namely a bid price recommendation service that saves you X% (any percent of money). If you want to buy some running shoes and save X%, this routine would be able to get the average sale price for the shoes. At that point, it just takes the percentage of the price and recommends you bid no higher than that - to save X%. Sure, you'll lose more auctions, but when you do win the auction, you'll know that you bought something for X% less than the average shopper. I could be wrong about some of the certification requirements. I intended to distribute my service (using the API) all along. If you want to use the API just for your own website or program, you probably still have to develop using their Sandbox. Did I actually give you more questions??