Created
May 22, 2024 15:59
-
-
Save mekarpeles/a4f1b2b0414325b9958fdc8376f14d16 to your computer and use it in GitHub Desktop.
python example of adding app identification headers to openlibrary.org API calls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
url = "https://openlibrary.org/search.json?q=test" | |
headers = { | |
"User-Agent": "MyAppName/1.0 (myemail@example.com)" | |
} | |
response = requests.get(url, headers=headers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment