Display Sold Items From Ebay using PHP

hi all

I am currently developing a position which needs to display items that have been sold on ebay for a user’s ebay account

i have attempted to come up with this but not luck can any one help me with this

$appid = "myid for app";
$xml = simplexml_load_file('http://open.api.ebay.com/shopping?callname=GetSingleItem&responseencoding=XML&appid=' . $appid . '&siteid=' . $siteid . '&version=897&IncludeSelector=Details');
$ack = strtolower( (string) $xml->Ack );
if( $ack == 'success' ) {
    echo "Items Sold : " . (int)$xml->Item->SoldList . "<br />";
}

What am i doing wrong ive tried to read it but i just want to grab the following information and save it in a database and i am needing this following information not sure where to find it
i need the following Listed Date,Ebay ID,Price of transaction Sold Date Buyername

can anyone help me out here?

Try URL encoding $appid
URLs and spaces don’t play well together

If you are happy using Composer I have developed an SDK that allows you to integrate with the eBay Shopping API. A simple example based on your code is shown below. Note that depending on what you are trying to achieve you may also want to look at the Trading API that eBay provides. There is a SDK available for that as well.

require __DIR__.'/vendor/autoload.php';

use \DTS\eBaySDK\Shopping\Services;
use \DTS\eBaySDK\Shopping\Types;

$service = new Services\ShoppingService(array(
    'apiVersion' => '897',
    'appId' => $appid
));

$request = new Types\GetSingleItemRequestType();

/**
 * Specify the item ID of the listing.
 */
$request->ItemID = '111111111111';
$request->IncludeSelector = 'Details';

$response = $service->getSingleItem($request);

if ($response->Ack !== 'Failure') {
    $item = $response->Item;
    print("$item->Title\n");
    printf("Quantity sold %s, quantiy available %s\n",
        $item->QuantitySold,
        $item->Quantity - $item->QuantitySold
    );
}

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.