{"id":20114506,"url":"https://github.com/chaosgen/google-news-scraper","last_synced_at":"2025-05-06T12:31:10.002Z","repository":{"id":261160122,"uuid":"881374459","full_name":"chaosgen/google-news-scraper","owner":"chaosgen","description":"Use Google News API to obtain the latest global news for your project, including a wide range of sources, headlines, URLs, and publication dates from the Google News platform.","archived":false,"fork":false,"pushed_at":"2024-10-31T12:57:37.000Z","size":35,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-05T02:37:38.411Z","etag":null,"topics":["api-for-google-news","api-google-news","api-stock-news","free-google-news-api","google-news-api","google-news-scraper","google-scraper","google-scraper-api","google-search-scraper","news-scraper","news-scraper-api","python","scraper-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaosgen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-31T12:57:18.000Z","updated_at":"2024-11-05T01:47:52.000Z","dependencies_parsed_at":"2024-11-05T02:37:44.521Z","dependency_job_id":null,"html_url":"https://github.com/chaosgen/google-news-scraper","commit_stats":null,"previous_names":["chaosgen/google-news-scraper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaosgen%2Fgoogle-news-scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaosgen%2Fgoogle-news-scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaosgen%2Fgoogle-news-scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaosgen%2Fgoogle-news-scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaosgen","download_url":"https://codeload.github.com/chaosgen/google-news-scraper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224503548,"owners_count":17322224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-for-google-news","api-google-news","api-stock-news","free-google-news-api","google-news-api","google-news-scraper","google-scraper","google-scraper-api","google-search-scraper","news-scraper","news-scraper-api","python","scraper-api"],"created_at":"2024-11-13T18:29:58.689Z","updated_at":"2025-05-06T12:31:09.993Z","avatar_url":"https://github.com/chaosgen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scraping Google News\n\n[![Oxylabs promo code](https://user-images.githubusercontent.com/129506779/250792357-8289e25e-9c36-4dc0-a5e2-2706db797bb5.png)](https://oxylabs.go2cloud.org/aff_c?offer_id=7\u0026aff_id=877\u0026url_id=112)\n\n[![](https://dcbadge.vercel.app/api/server/eWsVUJrnG5)](https://discord.gg/GbxmdGhZjq)\n\n- [Free Google News Scraper](#free-google-news-scraper)\n    + [Prerequisites](#prerequisites)\n    + [Installation](#installation)\n    + [Getting the topic to scrape](#getting-the-topic-to-scrape)\n    + [Scraping](#scraping)\n    + [Notes](#notes)\n- [Oxylabs Google News API](#oxylabs-google-news-api)\n    + [Request sample](#request-sample)\n\n\n## Free Google News Scraper\n\n### Prerequisites\n\nTo run this tool, you need to have Python 3.11 installed in your system. \n\n### Installation\n\nOpen up a terminal window, navigate to this repository and run this command:\n\n`make install`\n\n### Getting the topic to scrape\n\nThis tool is used to scrape Google News articles based on the topic they're listed in. \n\nFirst of all, open up Google News, and look through the topics listed in the top header of the webpage. \n\n\u003cimg width=\"1388\" alt=\"image\" src=\"https://github.com/oxylabs/google-news-scraper/assets/44357929/c30be402-90cb-41ba-95a4-b2f63cdf5a7f\"\u003e\n\nClick on a topic you wish to scrape. \nIn this example we'll be using the `Business` topic. \n\nNext, look at the URL in your browser and copy the string of characters that come after `/topics/`, that's your topic ID.\n\n\u003cimg width=\"831\" alt=\"image\" src=\"https://github.com/oxylabs/google-news-scraper/assets/44357929/cc3efc01-e719-4497-80f9-45710cb47977\"\u003e\n\nIn the URL shown in the screenshot, the topic ID would be `CAAqJggKIiBDQkFTRWdvSUwyMHZNRGx6TVdZU0FtVnVHZ0pWVXlnQVAB`. \n\nSave this value, you'll need it for scraping the articles.\n\n### Scraping \n\nTo scrape articles from your selected topic, run this command in your terminal:\n`make scrape TOPIC_ID=\u003cyour_selected_topic_id\u003e`\n\nWith the `Business` topic ID selected before, the command should look like this:\n\n`make scrape TOPIC_ID=CAAqJggKIiBDQkFTRWdvSUwyMHZNRGx6TVdZU0FtVnVHZ0pWVXlnQVAB`\n\nAfter running the command, you should see this in your terminal:\n\n\u003cimg width=\"1177\" alt=\"image\" src=\"https://github.com/oxylabs/google-news-scraper/assets/44357929/ad3e8211-043d-40fe-87e3-89fc9fea2381\"\u003e\n\nWhen the tool has finished running, you should see a file named `articles.csv` in the directory you were running the tool.\n\nIf you open the generated CSV file, the data should look something like this:\n\n\u003cimg width=\"1277\" alt=\"image\" src=\"https://github.com/oxylabs/google-news-scraper/assets/44357929/7127198e-1aa9-468d-a6e6-b989a68085f3\"\u003e\n\n\n### Notes\n\nIn case the code doesn't work or your project is of bigger scale, please refer to the second part of the tutorial. There, we showcase how to scrape public data with Oxylabs Scraper API.\n\n## Oxylabs Google News API\n\nYou can get a [7-day trial for Oxylabs Google News API](https://oxylabs.io/products/scraper-api/serp/google/news) and get **free 5K results**.  The tool will deliver a list of **sources, titles, URLs, and dates from published articles** all over the Google News portal. This API returns real-time data and gives access to localized results, all while avoiding blocks. \n\nAfter you claim your trial, using Google News API consists of three main steps:\n1. Create your API user via our [dashboard](https://dashboard.oxylabs.io)\n2. Send a request\n3. Retrieve the data in JSON or HTML\n\n### Request sample\nIn the example below, we use Google News API and make a request to collect search result pages for the search term `adidas` on the `google.nl` domain: \n\n```\nimport requests\nfrom pprint import pprint\n\n# Structure payload.\npayload = {\n    'source': 'google_search',\n    'domain': 'nl',`\n    'query': 'adidas',\n    'parse': True,\n    'context': [\n        {'key': 'tbm', 'value': 'nws'},\n    ],\n}\n\n# Get response.\nresponse = requests.post(\n    'https://realtime.oxylabs.io/v1/queries',\n    auth=('USERNAME', 'PASSWORD'),\n    json=payload,\n)\n\n# Print prettified response to stdout.\npprint(response.json())\n```\n\nTo see **request samples in other languages** and **parameter values** along with their **descriptions**, please take a look at our extensive [Google News API documentation](https://developers.oxylabs.io/scraper-apis/serp-scraper-api/google/news-search). \n\nRead More Google Scraping Related Repositories: [Google Sheets for Basic Web Scraping](https://github.com/oxylabs/web-scraping-google-sheets), [How to Scrape Google Shopping Results](https://github.com/oxylabs/scrape-google-shopping), [Google Play Scraper](https://github.com/oxylabs/google-play-scraper), [How To Scrape Google Jobs](https://github.com/oxylabs/how-to-scrape-google-jobs), [How to Scrape Google Scholar](https://github.com/oxylabs/how-to-scrape-google-scholar), [How to Scrape Google Flights with Python](https://github.com/oxylabs/how-to-scrape-google-flights), [How To Scrape Google Images](https://github.com/oxylabs/how-to-scrape-google-images), [Scrape Google Search Results](https://github.com/oxylabs/scrape-google-python), [Scrape Google Trends](https://github.com/oxylabs/how-to-scrape-google-trends)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaosgen%2Fgoogle-news-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaosgen%2Fgoogle-news-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaosgen%2Fgoogle-news-scraper/lists"}