我如何从BING搜索引擎API返回JSON结果(How do i return JSON results from BING Search Engine API)

编程入门 行业动态 更新时间:2024-10-28 08:20:56
我如何从BING搜索引擎API返回JSON结果(How do i return JSON results from BING Search Engine API)

目前,我只能在登录datamarket azure的基础上进行搜索。

返回的结果格式化为表格形式,我不想以任何方式以JSON格式返回它们。

返回结果后显示一个链接,但当该链接粘贴到浏览器的URL部分时,它需要用户名和密码。

返回的网址示例https://api.datamarket.azure.com/Bing/Search/v1/Web?Query=%27car%27

曾经有一个API使用REST,但现在它只返回错误,不再工作。

有没有什么方法可以使用这个BING API并检索它的返回查询?

未能尝试登录到azure后返回错误您所提供的授权类型不受支持。 只支持Basic和OAuth

At the moment i am only able to do my searches based on logging in to datamarket azure.

Results returned are formatted in a table form and i dont fidn any way to return them in JSON format.

A link is displayed after results are returned but when that link is pasted in the URL section of a browser it requires a username and a password.

Example of returned URL https://api.datamarket.azure.com/Bing/Search/v1/Web?Query=%27car%27

There used to be an api Using REST for it but now it only return errors and is no longer working.

Is there any way to use this BING API and retrieve it's return queries?

Returned Error after failing to attempt to log in to azure The authorization type you provided is not supported. Only Basic and OAuth are supported

最满意答案

您需要从网址中移除v1 ,并在查询结尾添加$format=json ,如架构指南中所述 :

https://api.datamarket.azure.com/Bing/Search/Web?Query=%27Xbox%27&$format=json

要使链接正常工作,您需要提供您的散列凭据,以获取该信息,请按照下列步骤操作:

登录到Azure Marketplace。 浏览到搜索API列表 点击“浏览此数据集”链接(仅在您登录时才可见)。 打开后,点击“主帐户密钥”旁边的“显示” 在这里输入图像描述 保存该散列值并将其作为验证摘要用于您的代码中。

You need to remove the v1 from your URL, and add $format=json to the end of your query, as detailed in the schema guide:

https://api.datamarket.azure.com/Bing/Search/Web?Query=%27Xbox%27&$format=json

To get the link to work, you need to provide it your hashed credentials, to get that, follow these steps:

Login to the Azure Marketplace. Browse to the search api listing Click on the "Explore this Dataset" link (its only visible if you are logged in). Once it opens, on the top click on "Show" next to "Primary Account Key" enter image description here Save this hashed value and use it in your code as the authentication digest.

更多推荐

本文发布于:2023-04-29 13:01:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1336442.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:搜索引擎   JSON   API   BING   Search

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!