Skip to content

Instantly share code, notes, and snippets.

@hughpearse
Created May 19, 2021 16:39
Show Gist options
  • Save hughpearse/7cf00a40c2669da7dbf49ffa1646ee0c to your computer and use it in GitHub Desktop.
Save hughpearse/7cf00a40c2669da7dbf49ffa1646ee0c to your computer and use it in GitHub Desktop.
import requests
import json
headers = {'Accept': 'application/json', 'User-Agent': 'Hugh'}
url = "https://reddit.com/r/worldnews.json"
r = requests.get(url, headers=headers)
print(r.json()['data'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment