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 <[email protected]> Date: Wed, Jul 30, 2025 at 3:34 PM Subject: [Wikitech-l] Enforcement of the Wikimedia User-Agent policy To: Wikimedia developers <[email protected]> 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/Product_%26_Technology_OKRs/en#Responsible_Use_of_Infrastructure_(WE5) [2] https://foundation.wikimedia.org/wiki/Policy:Wikimedia_Foundation_User-Agent_Policy [3] https://phabricator.wikimedia.org/T400119 -- Giuseppe Lavagetto Principal Site Reliability Engineer, Wikimedia Foundation _______________________________________________ Wikitech-l mailing list -- [email protected] To unsubscribe send an email to [email protected] https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/ -- Isaac Johnson <https://meta.wikimedia.org/wiki/User:Isaac_(WMF)> (he/him) -- Senior Research Scientist -- Wikimedia Foundation _______________________________________________ Wiki-research-l mailing list -- [email protected] To unsubscribe send an email to [email protected]
