Cross-posting this message to wiki-research-l. If you do research where you're gathering data from Wikimedia APIs, you should make sure to explicitly set the user-agent. This is relatively simple depending on the libraries that you are using. Important things to include are a descriptive/unique name for the project and a method of contact. This can be achieved jointly by pointing to your Meta project page https://meta.wikimedia.org/wiki/Research:Projects if you have created one or at least an email or Wikimedia username.
Examples from Python:
- If you're using the mwapi https://github.com/mediawiki-utilities/python-mwapi/tree/master Python library, you can just set the `user_agent` parameter when creating a session -- e.g., user_agent = "[[m:Research:Language switching behavior on Wikipedia]]" - If you're using a more general library like requests https://docs.python-requests.org/, then you can still easily set it -- e.g., requests.get(... headers={'User-Agent': "[[m:Research:Language switching behavior on Wikipedia]]"})
Best, Isaac
---------- Forwarded message --------- From: Giuseppe Lavagetto glavagetto@wikimedia.org Date: Wed, Jul 30, 2025 at 3:34 PM Subject: [Wikitech-l] Enforcement of the Wikimedia User-Agent policy To: Wikimedia developers wikitech-l@lists.wikimedia.org
Hi,
As part of our work to ensure a fair use of our infrastructure[1], we are going to progressively enforce our long-standing user-agent policy[2] more systematically than we used to.
This will mean that, unless you set a user-agent that complies with the policy, your requests will be rate-limited and eventually blocked over the coming month. As usual, this excludes requests coming directly from toolforge/wikimedia cloud services.
For details on the schedule and further discussion please refer to the phabricator task[3]
Cheers,
Giuseppe
[1] https://meta.wikimedia.org/wiki/Wikimedia_Foundation_Annual_Plan/2025-2026/P...)
[2] https://foundation.wikimedia.org/wiki/Policy:Wikimedia_Foundation_User-Agent... [3] https://phabricator.wikimedia.org/T400119
wiki-research-l@lists.wikimedia.org