You will need to encode your KeyKey account on Base64 and transfer it to each request using the Authorization header.
String bingUrl = "https://api.datamarket.azure.com/Bing/Search/................";
String accountKey = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
byte[] accountKeyBytes = Base64.encodeBase64((accountKey + ":" + accountKey).getBytes());
String accountKeyEnc = new String(accountKeyBytes);
URL url = new URL(bingUrl);
URLConnection urlConnection = url.openConnection();
urlConnection.setRequestProperty("Authorization", "Basic " + accountKeyEnc);
...
This code is based on a PHP example found in Migrating to the Bing Search API in a Windows Azure Marketplace document .
Refresh . The call to encodeBase64 has been changed, it should be as follows: accountKey + ":" + accountKey
source
share