RubyRube
RubyRube

Reputation: 602

New Bing Search API Key returns 401 permission denied

I have two new Bing API keys. I've placed them in my code in the correct places:

 function getSubscriptionKey() {
   var key = "c8a8bbc87015441295d7df8e70ed8e9d"; //     var key = retrieveValue(API_KEY_COOKIE);
    while (key.length !== 32) {
    key = prompt("Enter Bing Search API subscription key:", "").trim();
   }
   // always set the cookie in order to update the expiration date
   storeValue(API_KEY_COOKIE, key);
   return key;
 }  

A search returns:

Error HTTP Status 401 PermissionDenied error: [object Object]

The search engine worked fine before. Bing may have changed their API.

Previously working codepen here:

https://codepen.io/Teeke/project/editor/XvymoQ

Upvotes: 1

Views: 729

Answers (1)

Ami
Ami

Reputation: 1

It may be the Pricing Tier you selected does not support the Bing query type you are performing. I put together this table:

Pricing Tier Estimate Calls per Second Video Search Image Search News Search Web Search Entity Search Auto-suggest Spell Check Related Search Visual Search Local Business Search URL Preview
F1 Free 1000 calls per month 3 Y Y Y Y Y Y Y N Y N N
S1 Standard $25 USD per 1000 calls 250 Y Y Y Y Y Y Y N N N N
S2 Standard $15 USD per 1000 calls 100 N N N Y N Y Y N N N N
S3 Standard $18 USD per 1000 calls 100 N Y N Y N N N N N N N
S4 Standard $18 USD per 1000 calls 100 Y N N Y N N N N N N N
S5 Standard $18 USD per 1000 calls 100 N N Y Y N N N N N N N
S6 Standard $15 USD per 1000 calls 100 N N N Y Y N N N N N N
S7 Standard $20 USD per 1000 calls 150 Y Y N Y N N N N N N N
S8 Standard $22 USD per 1000 calls 150 Y Y Y Y N N N N N N N
S9 Standard $15 USD per 1000 calls 30 N N N N N N N N Y N N
S15 Standard $28 USD per 1000 calls 250 Y Y Y Y Y Y Y N N N N
S16 Standard $200 USD per 1000 calls 250 Y Y Y Y Y Y Y N N N N

Upvotes: 0

Related Questions