13 ms·
Show HN: NewsAPI – A free API for live news headlines and images
- highace 10y agoHi HN! This is my side project. I needed to integrate the latest headlines and images from a range of popular news sources and blogs into my app, and found that there wasn't a single API available that brought all the metadata together in a simple and consistent way. So I made one. It sources data from individual APIs, RSS feeds, and plain old scraping, and outputs in JSON. Here's some example responses: TechCrunch: https://newsapi.org/v1/articles?source=techcrunch&sortBy=latest&apikey=3e22f2fcc1344975ae2b2e69379e2a6e https://newsapi.org/v1/articles?source=techcrunch&sortBy=lat... Reuters: https://newsapi.org/v1/articles?source=reuters&sortBy=latest&apikey=3e22f2fcc1344975ae2b2e69379e2a6e https://newsapi.org/v1/articles?source=reuters&sortBy=latest... BBC News: https://newsapi.org/v1/articles?source=bbcnews&sortBy=top&apikey=3e22f2fcc1344975ae2b2e69379e2a6e https://newsapi.org/v1/articles?source=bbcnews&sortBy=top&ap...
- erlehmann_ 10y agoWhy is the output format not RSS or Atom feeds? It could be trivially collected and re-used then without coding to your API.
- highace 10y agoGreat suggestion. I'll put this on the road map.
- erlehmann_ 10y agoNice. I would suggest to always use Atom instead of RSS, as it can do everything RSS can and more (e.g. multiple enclosures).
- LaurenceW1 10y agois this open source?
- lioeters 10y agoExcellent! Well-executed design, and the service looks very useful, with a variety of potential applications. I love how this API provides simple access to a uniform data format for these news sources. "It sources data from individual APIs, RSS feeds, and plain old scraping.." This is what many developers have had to do, solving it each in their own way, and I think it's valuable to have that layer abstracted. Although, I imagine it's not trivial to maintain these algorithms, to keep up with changes in each news source. Since the chosen data format is so straight-forward, it'd probably require just a thin transformation step to produce RSS or Atom feeds from the API. Would love to see an open-source, self-hosted option.
- lioeters 10y agoTo add a minor point which might be improved: upon visiting the home page, there is a FOUC - flash of unstyled content; the whole list of news sources can be seen, before the "type writer" JavaScript effect kicks in. Probably can be solved by hiding the text until the effect is loaded.
- highace 10y agoGood spot, I'll fix this shortly :)
- highace 10y agoThanks! I'm sure you're right - in the past developers will have simply consumed each source's API within their app, which is exactly what I did to begin with. The algorithms will need maintaining, especially in the case of the scraped sites. I'll be relying on this service for my main project so it's something I'd need to keep track of anyway.
- LaurenceW1 10y agoso thats a solid no to open sourcing it?
- highace 10y ago