简体   繁体   English

如何使用 REST api 查询 IBM Watson Discovery News?

[英]How to query IBM Watson Discovery News with REST api?

Is there an opportunity in IBM Watson Discovery News to query news just with the url where I can specify keywords, api etc. Would appreciate if anybody could share the template of such REST request. IBM Watson Discovery News 中是否有机会仅使用 url 查询新闻,我可以在其中指定关键字、api 等。如果有人可以分享此类 Z50780F47F6839D47D60BC45355EE00C 的模板,将不胜感激。 I created the account, launched the Discovery but then completely lost in the IBM Cloud API Docs https://cloud.ibm.com/apidocs/discovery .我创建了帐户,启动了 Discovery,但随后完全迷失在 IBM Cloud API Docs https://cloud.ibm.com/apidocs/discovery中。 As far as I can see, here everything is for accessing via command line but it is not what I'm looking for...据我所知,这里的一切都是为了通过命令行访问,但这不是我要找的......

This is what I used for Alchemy:这是我用于炼金术的:

https://access.alchemyapi.com/calls/data/GetNews?apikey= &return=enriched.url.title&start=1477008000&end=now&q.enriched.url.cleanedTitle=InsertTitle&count=100&outputMode=xml https://access.alchemyapi.com/calls/data/GetNews?apikey= &return=enriched.url.title&start=1477008000&end=now&q.enriched.url.cleanedTitle=InsertTitle&count=100&outputMode=xml

Best, Lada最好的,拉达

Occasionally all you need to do is read the documentation - https://cloud.ibm.com/apidocs/discovery#query-a-collection-get有时您需要做的就是阅读文档 - https://cloud.ibm.com/apidocs/discovery#query-a-collection-get


curl -u "apikey":"{apikey}" "https://gateway.watsonplatform.net/discovery/api/v1/environments/system/collections/news-en/query?version=2019-04-30&natural_language_query=corvid&count=10&return=text"

which becomes变成

https://apikey:{apikey}@gateway.watsonplatform.net/discovery/api/v1/environments/system/collections/news-en/query?version=2019-04-30&natural_language_query=corvid&count=100&return=text

although if you just run虽然如果你只是跑

https://gateway.watsonplatform.net/discovery/api/v1/environments/system/collections/news-en/query?version=2019-04-30&natural_language_query=corvid&count=10&return=text

you will be prompted for credentials.系统将提示您输入凭据。

You may need to amend the url endpoint to reflect the region you have your discovery service instance.您可能需要修改 url 端点以反映您拥有发现服务实例的区域。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM