Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force users to respect Wikipedia's User Agent policy #302

Open
XioNoX opened this issue Jul 14, 2023 · 3 comments
Open

Force users to respect Wikipedia's User Agent policy #302

XioNoX opened this issue Jul 14, 2023 · 3 comments

Comments

@XioNoX
Copy link

XioNoX commented Jul 14, 2023

(I'm a SRE at the Wikimedia Foundation)

We regularly get contacted by people getting rate limited while using the API, either directly or for example using your library.
Our API also gets occasionally and accidentally abused.

To help with those 2 issues, we require API users to define a non-default User-Agent, explained in this document: https://meta.wikimedia.org/wiki/User-Agent_policy

I'm wondering if it would be possible to add documentation in this regard to your library, as well as make the UA a mandatory configuration option.

You can see an example implementation on martin-majlis/Wikipedia-API#63

Thanks

@marcfrederick
Copy link
Member

I've added a new warning to the documentation and updated the initial examples/quickstart to set the clients_useragent in #306. I'm personally undecided about whether the user agent should be a mandatory field, as this would introduce a breaking change to the library and is not something that's actually required on all wikis.

@AdamWill
Copy link
Member

AdamWill commented Sep 6, 2023

Yeah, I have the same hesitation. For instance, my own use of mwclient is for the Fedora wiki, not Wikipedia, and that does not require a user agent.

@XioNoX
Copy link
Author

XioNoX commented Sep 7, 2023

Thanks for your answers!
It would be interesting to know the feedback from Wikipedia-API about the breaking change. But as it's something easy to implement on the user side, I don't see it as a blocker (doesn't require to do significant code change to be compliant).
From experience, users often don't follow recommendations from the documentation (at best do copy/paste).
Even if a wiki doesn't require a specific user agent, it seems to me that setting one is being "a good internet citizen".
To ease the breaking change side, one option could be to show a warning (like Python's famous DeprecationWarning) for some time.
Whatever direction you're going, thank you for looking and thinking about this ticket, it's appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants