Hi, Simple and effective API. The documentation lacks details about the query parameter. I want to search for A AND B but q=?A%20B does not yield the expected result (seems a OR query) or for exact phrase "A invests in B" do not seem to work. Can you please post details for advanced syntax like this?
Hi, thanks for the feedback! So far, I haven't implemented this feature yet. The query parameter gets tokenized as is, and then tokens are used to search in the index. Could you provide more details about your use case? As I understand you need to have AND, OR, NOT, grouping () operators, anything else? I would try to implement this today, and write back to you.
Show HN: News Searching API
31–40 of 43 posts
Re: Show HN: News Searching API
#32Earlier quoted context omitted.
Hi, thanks for the feedback! So far, I haven't implemented this feature yet. The query parameter gets tokenized as is, and then tokens are used to search in the index. Could you provide more details about your use case? As I understand you need to have AND, OR, NOT, grouping () operators, anything else? I would try to implement this today, and write back to you.
yes this is exactly what I (most users?) would need. Search for exact phrase would be a plus also. Eg: "donald trump" instead of Donald AND trump. What kind of backend are you using, a simple database or search index like elasticsearch (which would be more appropriate for such project)?
> curl -XGET -G 'api.datanews.io/v1/news' -d 'apiKey=API_KEY' --data-urlencode 'q="Europe throws new rule book at Google, tech giants to loosen market grip"'
> curl -XGET -G 'api.datanews.io/v1/news' -d 'apiKey=API_KEY' --data-urlencode 'q=google+facebook+amazon'
Supported operators:
+ AND, | OR, - NOT, () parentheses for grouping, "" exact match
EDIT: examples
Re: Show HN: News Searching API
#33Earlier quoted context omitted.
yes this is exactly what I (most users?) would need. Search for exact phrase would be a plus also. Eg: "donald trump" instead of Donald AND trump. What kind of backend are you using, a simple database or search index like elasticsearch (which would be more appropriate for such project)?
Hi, just finished implementing this stuff. To search a AND b use 'q=A+B'. Here are a few examples: > curl -XGET -G 'api.datanews.io/v1/news' -d 'apiKey=API_KEY' --data-urlencode 'q="Europe throws new rule book at Google, tech giants to loosen market grip"' > curl -XGET -G 'api.datanews.io/v1/news' -d 'apiKey=API_KEY' --data-urlencode 'q=google+facebook+amazon' Supported operators: + AND, | OR, - NOT, () parentheses f…
Re: Show HN: News Searching API
#34How do you get news from its sources?
First, I extract the links to the news articles by searching them on the home page or sitemaps. Then, for each article I scrap raw html and extract key things like title, description, publish date, authors, etc. Usually each news article has a schema embedded within it, so it greatly simplifies things of extracting article details.
Re: Show HN: News Searching API
#35Re: Show HN: News Searching API
#36I used to run a large US publisher with 50+ sites writing 50,000 articles a month; if we found someone scraping full articles and offering them for use via an API it would be a problem - even moreso if that person was charging for it. I'm all for hacking and innovation around this space, just be careful here and don't break TOS.
Re: Show HN: News Searching API
#37Earlier quoted context omitted.
First, I extract the links to the news articles by searching them on the home page or sitemaps. Then, for each article I scrap raw html and extract key things like title, description, publish date, authors, etc. Usually each news article has a schema embedded within it, so it greatly simplifies things of extracting article details.
Do you scrape using web requests? Or do you use headless browsing to load the page and extract the contents out of the DOM?
Re: Show HN: News Searching API
#38This is the side-project, that I have been building recently. The API allows searching over the data from many news sites and news aggregators, it also allows to easily extract whole news sites. I built it for two reasons. First, I wanted to have a source of recent news data to play with, essentially to run data analysis and train ml models on. Secondly, because alternative services had wildly high pricing, like 400-…
Re: Show HN: News Searching API
#39Earlier quoted context omitted.
This is a great question. Thus far I thought, that the content that is publicly available without any limitation (e.g. membership access), can be scraped by anyone. You can take a look at hiQ Labs vs. LinkedIn [1]. LinkedIn's public data was scraped by data analytics company, the ruling was against LinkedIn. I also think that the use case matters, I don't republish their content on the site, but merely provide it via…
hiQ Labs vs. LinkedIn is a bad example. It is super specific. LinkedIn did not owe the data (it was users'). In your case, you are reselling copyrighted product. Of course you can scrape. It does not mean you can distribute this.
Re: Show HN: News Searching API
#40This is the side-project, that I have been building recently. The API allows searching over the data from many news sites and news aggregators, it also allows to easily extract whole news sites. I built it for two reasons. First, I wanted to have a source of recent news data to play with, essentially to run data analysis and train ml models on. Secondly, because alternative services had wildly high pricing, like 400-…
I would love to integrate your product into Pipedream.com so developers can quickly integrate Datanews with other apps such as Slack, Discord, Reddit, Google Sheets, etc. Please reach out -- tod at pipedream.