alex9smith / gdelt-doc-api

A Python client for the GDELT 2.0 Doc API
MIT License
100 stars 23 forks source link

Set user agent on API requests #23

Closed alex9smith closed 1 year ago

alex9smith commented 1 year ago

The GDELT API seems to have started rate limiting requests without a user agent set (see #22). This PR sets the package name and version as the user agent for all requests to the API. Manual testing for rate limiting is an imprecise business, but I was able to reproduce the error before making this change and I've not seen it since.

This PR also restructures the versioning system slightly - this is needed so we can access the version number to set in the user agent.

Closes #22