eBay Tool that Texts Your Cell Phone on New Buy-it-Now Auctions
"This the season to be jolly!" Wait a minute! In the midst of the global economic downturn, how can anybody - except of course for those top-level corporate executives with hefty bonus packages - be “jolly” this season? I personally know of people - including myself - who have lost thousands of dollars in investments.
Hooray for even more expenses! I hate to be a Grinch, but it's hard to even think about gift giving in this economic crisis.Cut Corners with eBay
Missed Buy It Now eBay Auction Listings
eBay's completed listings is useful to check out because you can see what kind of items your money can fetch. However, I have a love/hate relationship with completed listings. While it is useful in gauging the market, I don't want to know that I've missed another a once-in-a-lifetime deal. Of course, you can remedy this feeling with eSnipe to deal with genuine, set-time auctions. But what about those Buy It Now steals that only benefit the "early birds?" Looking at completed buy-it-now listings, I occasionally think, "Damn, if I wasn't in class I could've gotten that!” or "Why was I watching TV when this item was listed!?” It seems the only way to avoid losing out on a buy-it-now steal is to constantly sit at your computer and hit the refresh button every minute!
Script with eBay's Shopping Query API
But, that's no fun. It doesn't have to be like that. Don't chase the eBay search. Let the eBay search come to you. I was tired of regretting missed deal after missed deal. And I was through with relying on eBay's heavily delayed "Saved Search" daily email subscription and buggy RSS search feed.
So, I rolled up my sleeves and wrote my own program to essentially "hit the refresh button" for me.![]()
Basically, this script obtains search results by utilizing the eBay's Shopping Query API. Every time there is a new Buy It Now listing that matches my criteria, I receive a text on my phone with the price and the listing title. If the item looks promising, I drop everything I do, dash to a computer, review the full description, and buy the item.
Setup
Initial installation is a bit technical, but it's worth it! Once, you've finalized your setup, creating and suspending subsequent search notifications will be a breeze!
- First, you have to make sure that you have access to a server that supports cron jobs, a variant of wget, and PHP. If you're using cPanel or something similar, everything is taken care of.
- Obtain a free AppID from eBay Developers. This will give you access to their API and database.
- On your server, create a folder containing an empty PHP file. Set the folder with writable permissions for everyone or just chmod to 777.
- Insert this code into the PHP file and replace "INSERT-YOUR-OWN-APPID-HERE" with your AppID, "PHONE-NUMBER@messaging.sprintpcs.com" with the target email address (or the cell phone's email address), and "EMAIL-ADDY@DOMAIN.com" with the email address you want displayed in the "From" header. The later email address is not really essential. You can even type in a dummy address.
PHP:
-
///////////////"POST" TEST//////////////////////////////////////
-
///////////////VARIABLES//////////////////////////////////////
-
$to = 'PHONE-NUMBER@messaging.sprintpcs.com';
-
$header = 'From: EMAIL-ADDY@DOMAIN.com' . "\r\n" .
-
//Need a Worldwide function when neccessary
-
//////////////////////////////////////////////////////////////////
-
foreach ($calls as $parms) {
-
$nickname = $parms[0];
-
$safeQuery = $parms[1];
-
$descflag = $parms[2];
-
$categ = $parms[3];
-
$priceRangeMin = $parms[4];
-
$priceRangeMax = $parms[5];
-
$results = '';
-
$endpoint = 'http://open.api.ebay.com/shopping';
-
$currIDs = "";
-
$apicall = "$endpoint?callname=FindItemsAdvanced"
-
. "&version=537"
-
. "&siteid=0"
-
. "&appid=INSERT-YOUR-OWN-APPID-HERE"
-
. "&QueryKeywords=$safeQuery"
-
. "&MaxEntries=200"
-
. "&ItemSort=PricePlusShipping"
-
. "&CategoryID=$categ"
-
. "&ItemType=AllFixedPriceItemTypes"
-
. "&PriceMin.Value=$priceRangeMin"
-
. "&PriceMax.Value=$priceRangeMax"
-
. "&DescriptionSearch=$descflag"
-
. "&IncludeSelector=SearchDetails"
-
. "&responseencoding=XML";
-
$resp = simplexml_load_file($apicall);
-
}
-
if (!$resp || $resp->TotalItems == 0) {
-
//echo "No Items for $nickname!";
-
break;
-
}
-
foreach($resp->SearchResult->ItemArray->Item as $item) {
-
$currIDs .= $item->ItemID . "\n";
-
mail($to, "", "BIN Notification for '" . $item->Title . "' (".(string)$item->ItemID.") - $" . $binprice, $header);
-
}
-
}
-
$currIDs .= "////////////////////////////\n";
-
file_put_contents("$nickname.txt",$currIDs,FILE_APPEND);
-
}
-
//var_dump($resp->SearchResult->ItemArray);
-
//echo $currIDs;
-
}
-
?>
-
- Now, you need to specify your search calls. The search call follows this format:
PHP:
-
$calls[] = array(0 => "SEARCH TERMS", "DESCRIPTION BOOLEAN",CATEGORY_NUMBER,MAX_PRICE,MINIMUM-PRICE);
- Replace "SEARCH TERMS" with the actual terms you type into the eBay search form like "ipod." Make sure you escape quotes if you search with exact phrases.
- For "DESCRIPTION BOOLEAN," specify "true" to search within the item's description or "false" to restrict the search to the title. Remember to include the double quotes.
- If you want to restrict search to a specific category, replace "CATEGORY_NUMBER" with the appropriate eBay category ID. To find this, you'll have to view the HTML source code of the category's page. Pretend you want to restrict the search to the Cell Phones & Smartphones subcategory. Visit the page of the category in eBay and view the HTML source. Search for "tcat=" (without quotes) and the next number should be the category ID.
- The last two fields are just for the minimum and maximum price. I think they're pretty self-explanatory. Remember to exclude the currency (dollar) symbol!
To give you an example, the following is one search call I currently keep on my watchlist.
PHP:You can add as many $calls lines as you want. When you are finished with one, just comment out or delete the line.
-
- Save the script and do a manual test run in your browser window. Then, check your email account to verify that you received something. I suggest you first perform a search on eBay and verify that there are a few search results so that you don't end up with a flooded or empty inbox. Also, make sure you append "?run=true" after your test URL. It's a mechanism I implemented so that search engines or wandering visitors don't accidentally run the script. If it works, great! If not, check your PHP error log or shoot me a message.
- Now that it works, program your server to automatically execute the script. Setup a chmod to automatically open the PHP URL?run=true. I set mine to run every 10 minutes. Depending on your server load, you may want to set the cron job to recur more or less.
Caveats
Now, there are a couple of miscellaneous things you should know when using this script.
- First, there are no repeat notifications. Once the script sends an alert to your email address or cell phone, it will not happen again. So, if the seller lower the price on an item you received an alert on a week ago, you won't know about it unless you pull up a complete list of search results on eBay.
- This script only works with Buy it Now items. You can modify "&ItemType=AllFixedPriceItemTypes" to do otherwise but I didn't see any reason to do that when I wrote this script.
- Unless eBay checks your code, your AppID is limited to sending 5000 calls to the eBay API. Keep that in mind if you decide to run this script every minute with 5 queries at a time.
- I've implemented a control mechanism to withhold sending notifications when matching items is greater than 10. You can change this on the line that contains:
PHP:
Just a warning, when I didn't add this control sequence, I accidentally sent 200 text messages to my phone. Needless to say, I'm now on the unlimited texts messaging plan. Luckily, my host and the Sprint email servers didn't flag me as a spammer … yet.
- That leads me to my next warning. If you're going to send notifications to your cell phone, don't subscribe to the 300 text messages per month plan. You'll thank me later.
- Lastly, feel free to customize this script and add your own search parameters. I know many of my readers reside out of the United States. Play around with the "&siteid=0" parameter. The eBay API is so flexible. Your tenacity and coding skill are the only things holding you back.
So, give the script a whirl! You'll be the first buyer to see the next Buy-it-Now deal and you'll have a competitive edge over the eBay market this holiday season. I'm only a comment or email away. Tell me about your experience with this script!

Subscribe by RSS Feed
Stumble it!
Furl This!
Reddit!
October 29th, 2008 at 2:10 pm
I found this post since it links to mine. I used to use Word 2007 a lot for posting to my blog. But that was till I discovered LiveWriter. You may be interested in this: http://blog.gadodia.net/using-windows-livewriter-to-publish-blog-posts/
Also, I used to have a problem with it till I realized at a much later date that it also has spellcheck: http://blog.gadodia.net/windows-live-writer-spell-check/
LiveWriter is a great replacement for Word 2007. Also, if you don't like either of these, just use FireFox or Chrome to type your posts directly into WordPress because both of them provide spell check right in the browser.
Cheers and thanks for linking to my post.