question

all_vintage_cards avatar image
0 Likes"
all_vintage_cards asked

Switching From Finding To Browse API - Looking For Guidance

I'm a somewhat novice developer and I built a small page on my site in PHP using some of the old templates that eBay had provided a while back. I'm now struggling to switch to the Browse API. I'm wondering if anyone has built a template with strings in PHP that shows what to use for headers specifically and a breakdown of variables using the search request in the Browse API.


Previously I had something like this but there are a few things I'm struggling with. Mostly the Oauth part---and the headers required for the Browse API. How would I implement them in code like this? I don't see any reference anywhere on how to do this. It looks like i need a new Oauth token, that expires every 18 months--is this correct? Would i just need to revisit, regenerate and replace the token on each page i use this?

// API request variables
$endpoint = 'https://api.ebay.com/buy/browse/v1/item_summary/search?';  // URL to call
//$version = '1.0.0';  // API version supported by your application
$appid = 'xx';  // Replace with your own AppID
$globalid = 'EBAY-US';  // Global ID of the eBay site you want to search (e.g., EBAY-DE)
$query = 'xx';  // You may want to supply your own query
$safequery = urlencode($query);  // Make the query URL-friendly

// Construct the findItemsByKeywords HTTP GET call
$apicall = "$endpoint?";
//$apicall .= "OPERATION-NAME=findItemsAdvanced";
$apicall .= "&SERVICE-VERSION=$version";
$apicall .= "&SECURITY-APPNAME=$appid";
$apicall .= "&GLOBAL-ID=$globalid";
$apicall .= "&q=$safequery";
$apicall .= "&affiliate.trackingId=xx";
$apicall .= "&affiliate.networkId=9";
$apicall .= "&affiliate.customId=xx";
$apicall .= "&paginationInput.entriesPerPage=30";
//$apicall .= "&sortOrder=WatchCountDecreaseSort";

$apicall .= "$urlfilter";



browse apiepn
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
peece_maker avatar image
0 Likes"
peece_maker answered

In the same position.

I also used their old template as a starting point.

And am wondering why eBay cannot supply a template for their new api.

The quality of the documentation is very low indeed... from geeks, for geeks... at best, incomplete... and, at worst, deliberately crap.

One message is: I'm clearly not geeky enough.

The other message is: eBay doesn't want the traffic that I could generate.

Rant over.

I managed to solve some of my problems (not that I've got the browse api working yet, but still) with this guy's help:

How to Integrate eBay API's with PHP - Part 1 (angelleye.com)

Good luck

10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.