URL format for Google News RSS feed

前端 未结 4 652
盖世英雄少女心
盖世英雄少女心 2020-12-22 18:29

Google deprecated the old RSS feed URL format December 1st 2017 (deprecation notice), in addition to that they dropped the button in the Google News interface to generate a

相关标签:
4条回答
  • 2020-12-22 18:58

    Found an up-to-date library (1) that uses Google News RSS.

    The URL new format seems to be:

    Top news:

    https://news.google.com/news/rss
    

    By major topic:

    https://news.google.com/news/rss/headlines/section/topic/{topic}
    

    Where {topic} is one of the following values: WORLD NATION BUSINESS TECHNOLOGY ENTERTAINMENT SPORTS SCIENCE HEALTH

    By any/custom topic:

    Once at https://news.google.com, browse to the desired topic, for example this. Identify the topic ID in its URL, e.g. CAAqIQgKIhtDQkFTRGdvSUwyMHZNR056T1hFU0FtVnVLQUFQAQ, and use the format:

    https://news.google.com/rss/topics/{id}?hl={lang}
    

    In the format above, essentially rss/ is added after https://news.google.com/.

    By geolocation:

    https://news.google.com/news/rss/headlines/section/geo/{location}
    

    Not sure about the formatting for the {location} parameter

    By search query:

    New link: https://news.google.com/rss/search?q={query}
    Old link: https://news.google.com/news/rss/search/section/q/{query}
    

    Where the {query} parameter is a free text search

    Specifying country and language:

    For example if you wish to have news in Swedish and located from Swedish sources, add the following query string to the URL to change country and language to sv-SE: ?hl=sv&gl=SE&ceid=SE%3Asv

    0 讨论(0)
  • 2020-12-22 19:03
    1. Requests to the Geo endpoint seem to be working again.

      e.g. https://news.google.com/news/rss/headlines/section/geo/{place_name}

    2. Also, if you use the non-geo search, you can specify a 7-day window by adding +when:7d to your search.

      e.g. https://news.google.com/rss/search?q={key_words}+when:7d

    0 讨论(0)
  • 2020-12-22 19:18

    Updated Google RSS News Feed
    You can try this as well.
    https://news.google.com/rss?hl=en-NG&gl=NG&ceid=NG:en

    0 讨论(0)
  • 2020-12-22 19:23

    This options isn't valid anymore: https://news.google.com/news/rss/headlines/section/topic/{topic} produces Error 500.

    This seems to work: https://news.google.com/news?cf=all&hl=en&pz=1&ned=us&q=astronomy&output=rss

    The Geolocation mentioned above still works too. You can also specify city and state: https://news.google.com/news/rss/headlines/section/geo/DenverCo

    0 讨论(0)
提交回复
热议问题