Skip to content

Instantly share code, notes, and snippets.

@mekarpeles
Created May 22, 2024 15:59
Show Gist options
  • Save mekarpeles/a4f1b2b0414325b9958fdc8376f14d16 to your computer and use it in GitHub Desktop.
Save mekarpeles/a4f1b2b0414325b9958fdc8376f14d16 to your computer and use it in GitHub Desktop.
python example of adding app identification headers to openlibrary.org API calls
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