question

improveyourlife avatar image
0 Likes"
improveyourlife asked

how can i create a simple search with item number

Hi I have been nudged in the ebay API direction to get results off a listed item, how can I do this just the get SHIPPING COST with the API... this is just one instance, I would like to get my head round it.
list by item number
· 4
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.

What programming language are you thinking of implementing this in? If it's PHP I may be able to provide some example code.
0 Likes 0 ·
That would be great php is what im using, im using SIMPLE DOM for now
0 Likes 0 ·
Do you have an example item number that I could incorporate into some code? Do you wish to use the Trading service or a difference service such as the Finding or Shopping?
0 Likes 0 ·
Show more comments
clickimusprime avatar image
0 Likes"
clickimusprime answered
Procedural style: $appid = "yourappid"; $url = ' http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsAdvanced'; $url .= '&SERVICE-NAME=FindingService&SERVICE-VERSION=1.0.0&GLOBAL-ID=EBAY-US'; $url .= '&SECURITY-APPNAME=' . $appid . '&RESPONSE-DATA-FORMAT=XML'; $url .= '&categoryId=293'; $resp = file_get_contents($url); $xml = new SimpleXMLElement($resp); foreach($xml->searchResult->item as $item) { $itemid = (string) $item->itemId; $shipcost = (string) $item->shippingInfo->shippingServiceCost; echo $itemid . " " . $shipcost . "
\n"; } You build the URL following the format described in the docs. The url can be created on a single line, it's broken apart here for readability in forum limits. The itemid and shipping cost line reflect the structure of the XML. You can view the XML nicely formatted in Firefox by entering the same URL in the address bar. So you can prepare, edit, and test request URLs without coding then drop them into your code. Look for the available parameters and the "URL format" section in the docs. No XML is formatting required to place the call and the SimpleXMLElement converts the XML output to an object for easy access to the XML response. Trading API calls that require POST instead of GET are a bit more complicated, but this works well for Finding API. With this approach, you don't have to worry about an SDK going out of date when eBay makes changes, but you have to create the URL strings yourself. Once you have a basic understanding of the API features, it's less work than writing to an SDK.
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.

improveyourlife avatar image
0 Likes"
improveyourlife answered
Yes its php
· 1
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.

Can you please help me to search ebay product by item number?

Please send an email at thegreatengineer4@gmail.com

0 Likes 0 ·
improveyourlife avatar image
0 Likes"
improveyourlife answered
I just need to know how to call off any item number what price an item is plus a fee more but once thats inplace i could understand the api call
· 1
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.

I've added an anwser to this question but it's not appearing as it's waiting to be approved by the Forum moderators. I think as long as you are logged into this Forum, you can see it at https://forums.developer.ebay.com/answers/16556/view.html Hopefully the answer will appear soon once the moderators have a chance to look at it.
0 Likes 0 ·
improveyourlife avatar image
0 Likes"
improveyourlife answered
Cant see anything?
· 1
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.

Looks like only I can see the answer until it's approved. I've therefore copied it into this Gist https://gist.github.com/davidtsadler/c06bc7f02e0dd3b95b23028ee1a059e7
0 Likes 0 ·
improveyourlife avatar image
0 Likes"
improveyourlife answered
Will take a look, on first glance, is this ebays side? require __DIR__.'/vendor/ autoload.php';
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.

davidtsadler avatar image
0 Likes"
davidtsadler answered
The line `require __DIR__.'/vendor/ autoload.php';` is how you load the SDK into your projects. There is more information in the [documentation for the SDK]( http://devbay.net/sdk/guides/getting-started/installation.html#installing-via-composer). Be aware that the SDK is something I have developed. It is in no way endorsed, sponsored or maintained by eBay.
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.

improveyourlife avatar image
0 Likes"
improveyourlife answered
Could this be incorporated into anpho website?
· 1
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.

Yes. As long as you have a webserver that can serve PHP files. You could create a site that is powered by PHP and that uses the SDK to talk to the eBay API. For example it's possible to have a HTML form that allows someone to enter an item that will be passed to the PHP when the form is submitted. The code can then access this item id and pass it to the SDK using something like `$request->ItemID = $_POST['itemId'];`
0 Likes 0 ·
improveyourlife avatar image
0 Likes"
improveyourlife answered
I get this error click prime? Parse error: syntax error, unexpected 'foreach' (T_FOREACH)
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.

improveyourlife avatar image
0 Likes"
improveyourlife answered
OH mate, im on it now... I get it, thanks all for info
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.

improveyourlife avatar image
0 Likes"
improveyourlife answered
Last one, if I incorporate a form to search for attributes by itemid does the url change, if so to what? I noticed im getting results by categoryId=293
· 1
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.

You would change `$url .= '&categoryId=293';` to `$url .= '&keywords=your-item-id';`. I have a tool that allows you to build URLs for the findItemsAdvanced. http://devbay.net/developers/tools/bobbie/ . Just fill in the fields with the information you need for the search. The fields match the ones found in the documentation for findItemsAdvanced.
0 Likes 0 ·

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.