Search code examples
iosweb-servicesgeospatialfeed

Get current news for a location


Is it possible in an iOS application to get current news for a particular location ? Is there some api available where I can pass location as parameter and get news for that location ?


Solution

  • For local news in the US, you can use the Patch api, it allows you to get news for a zip code, state, or even down to a neighbourhood.

    here are some examples from their API page:

    News for a zip code

    http://news-api.patch.com/v1.1/zipcodes/{ZIP}/stories?dev_key={key}&sig={signature}

    News for a state

    http://news-api.patch.com/v1.1/states/{state name}/stories?dev_key={key}&sig={signature}

    News for a City

    http://news-api.patch.com/v1.0/states/ca/cities/san%20francisco/stories?dev_key={key}&sig={signature}

    News using GPS coordinates

    http://news-api.patch.com/v1.1/nearby/{latitude},{longitude}/stories?dev_key={key}&sig={signature}

    Response will contain lots of metadata, a title, a story, attachments, and even GPS coordinates of the location of the news items returned, with tons of other features

    Now the down side this is US only, there are many other APIs out there that you can use for different countries, here's the BBC API for example Update:This is down now

    You can grab news data from places, like this call http://api.bbcnews.appengine.co.uk/stories/uk Update: This is also down. You may use their RSS feeds instead.

    Also CNN has it's news RSS feed Where you can fetch RSS data about news in many locations

    • World
    • Africa
    • Americas
    • Asia
    • Europe
    • Middle East
    • U.S.

    I'm pretty sure there are tons of other APIs out there, one of my favorites is the Ushahidi network

    They have a public API that also has location tags for news items, you can learn more here

    I think this is quite enough to get you started and to show you the possibilities of open APIs, if you need more details please let me know, I'm pretty sure there's more out there if you search right !