Get the new updates at the project homepage in codeplex.
Well, since the opening of bing.com I’ve been playing with the API and some of the options it provides. Certainly I was getting annoyed since I had to rebuild each of my queries if I wanted something so I search for a library that could do this for me which I couldn’t find and I ended up writing my own.
Requirements: PHP5 and cURL
How to use this API? Here is a simple demonstration
// Include the Bing API PHP Library
require_once 'library/BingAPI.php';
// Simply start the class with your AppID argumented
$search = new BingAPI('YOUR APPID KEY');
// Build your query easily
/* To use multiple resources simply do ->setSources('Web+Image') ,
it must match the source type
bling.com provides */
$search->query('gimp')
->setSources('Web')
->setFormat('xml') /* Also you can try: xml, soap or json */
->setOptions(
array(
'Web.Count' => '10',
'Web.Offset' => '0',
'Adult' => 'Moderate',
'Options' => 'EnableHighlighting')
);
/* Check the API documentation in bing.com for more information */
/* This will give you a raw output */
echo $search>getResults();
I’d hope this little library makes your life easier :) Soon there’ll be a tracker if there are problems with it or you can comment here.
Download it now | Check the documentation | Get a Developer API Key
Heads up: There will be soon a better way to issue bugs
Any issues: http://bingapiphp.codeplex.com/WorkItem/List.aspx
Project Homepage
About SOAP Implementation
It seems I have made silly mistake with SOAP, there is actually no current SOAP implementation and it will be supplied soon.

Wow. Very useful PHP Lib. I will download and try to use it. Of course will tweet this.
You might want to re-download again. Just fixed a few things
Pingback: API para bing | rhypee 2.0
Pingback: Edgar A. Ronda
Pingback: » API PHP para Bing
It is cool, congratulation.
Pingback: Using APIs With PHP? Here Are Your Classes | Jeez Tech
what about version 2?
As in releasing a new version? Don’t know, hard to say since I’m not really motivated to extend it. The source is free to fork since it’s under the MIT license :)
My friend, you have to urlencode() the query before putting it to the query string.
Searching for more then one word will result in “400 Bad request” from Bing.
I did mention it, here http://routecafe.com/posts/bing-api-php-v11-release.moccha
Of course, I guess I should have fixed the examples…