使用新的API兵(的NodeJS) [英] Using the new Bing API (nodejs)

查看:148
本文介绍了使用新的API兵(的NodeJS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想切换到现在托管在Azure上和新的必应搜索API为大多数人所知的的appid 参数已进行身份验证删除,我想不出一个简单的方法来获取查询的结果。

I am trying to switch over to the new bing search api which is now hosted on azure and as most of you know that the Appid parameter has been removed for authentication, I can't figure out an easy way to get the results of the query.

我使用 HTTP 模块和的NodeJS当前code使用 http.get 查询 api.bing.net

I am using http module for nodejs and the current code uses http.get to query the api.bing.net .

有人能告诉我code正确使用新的?

Can someone show me the code to use the new one correctly?

我想这一点,但URL不返回任何东西
http://gavinmhackeling.com/blog/ 2012/05 /使用最炳搜索API-在蟒蛇/

I tried this, but the url fails to return anything http://gavinmhackeling.com/blog/2012/05/using-the-bing-search-api-in-python/

推荐答案

抱歉,在我的博客文章错字。

Sorry, there was a typo in my blog post.

请确保您使用的是默认的账号密码从 https://datamarket.azure.com/account /键的。

Make sure that you are using your default account key from https://datamarket.azure.com/account/keys.

要使用基本身份验证,取代&LT; YourDefaultAccountKey&GT; 中<$c$c>https://user:<YourDefaultAccountKey>@api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27leo%20fender%27&Market=%27en-US%27&$top=50&$format=JSON.您将在JSON返回结果。

To use the basic authentication, replace <YourDefaultAccountKey> in https://user:<YourDefaultAccountKey>@api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27leo%20fender%27&Market=%27en-US%27&$top=50&$format=JSON. You will be returned results in JSON.

您也可以使用 https://datamarket.azure。 COM /数据/探索/ 5BA839F1-12CE-4CCE-BF57-A49D98D29A44 测试查询参数和格式。

You can also use https://datamarket.azure.com/dataset/explore/5BA839F1-12CE-4CCE-BF57-A49D98D29A44 to test query parameters and formatting.

这篇关于使用新的API兵(的NodeJS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆