gpt4 book ai didi

json - 如何根据搜索查询从stackoverflow API 获取问题列表?

转载 作者:行者123 更新时间:2023-12-03 16:17:36 24 4
gpt4 key购买 nike

我对根据标签或搜索查询获取问题列表感兴趣。我给你举个例子。

因此,如果我使用搜索关键字为“ipv4”,它应该会给我一个很大的与 ipv4 相关的问题列表。我想要做的就是将问题(标题)作为列表或数组获取,以便我可以对其进行一些处理。

最佳答案

您可以使用 questions/ 获取此信息。路线。在此调用中,您会将您感兴趣的标签传递给 tagged参数(以分号分隔 ( ; ))。

To constrain questions returned to those with a set of tags, use the tagged parameter with a semi-colon delimited list of tags. This is an and constraint, passing tagged=c;java will return only those questions with both tags. As such, passing more than 5 tags will always return zero results.



对于您的特定问题(搜索 ipv4 ),您可以以此为起点:
http://api.stackexchange.com/docs/questions#order=desc&sort=activity&tagged=ipv4&filter=!BHMIbze0EPheMk572h0ktETsgnphhU&site=stackoverflow&run=true
filter是可选的,但我已经删除了一些默认字段以呈现一个较小的示例。上面的链接返回如下所示的条目:
"items": [
{
"tags": [
"ruby-on-rails",
"ipv4",
"geokit"
],
"link": "http://stackoverflow.com/questions/29460004/rails-geokit-incorrectly-converting-ipv4-address-to-latitude-and-longitude",
"title": "Rails: Geokit incorrectly converting IPv4 address to latitude and longitude"
},
{
"tags": [
"networking",
"ip",
"ipv4",
"maxmind",
"cidr"
],
"link": "http://stackoverflow.com/questions/28358851/merging-of-multiple-ipv4-address-blocks-on-the-basis-of-their-country-region",
"title": "merging of multiple IPv4 address blocks on the basis of their country region"
},
...
}

关于json - 如何根据搜索查询从stackoverflow API 获取问题列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29433422/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com