Jump to content

Policy talk:Wikimedia Foundation User-Agent Policy

From Wikimedia Foundation Governance Wiki
Latest comment: 1 month ago by DKinzler (WMF) in topic Contact Info and API Guidelines

Help With User Agent

Hello! I am trying to make an application using the wiktionary api. I followed the example to add a User-Agent parameter to my request with a description of the application and contact information. It still gives me the following response however:

"Please set a user-agent and respect our robot policy https://w.wiki/4wJS. See also T400119."

Is there something necessary I'm missing, other than the User-Agent parameter specified on this page? Samot2 (talk) 04:23, 8 October 2025 (UTC)Reply

Hi Samot2. Unfortunately we cannot help with technical questions at this talkpage. Please ask your question at m:Tech or one of the other locations documented in mw:Communication. I hesitantly suggest (speaking as a non-developer) that it might be helpful (for potential responders to your question) if you could either link to your existing code, or just provide more details about what precise parameters you are currently using (so that they can more easily respond with suggestions for changes/additions/etc). I hope that information helps. Quiddity (WMF) (talk) 19:12, 8 October 2025 (UTC)Reply

mw.ForeignApi

Hi!

Does this work with mw.ForeignApi? In the only signature that I'm aware of, mw.ForeignApi accepts a string which is the foreign domain. I can't find any mention of userAgent in the source code for mw.ForeignApi Nirmos (talk) 00:51, 3 November 2025 (UTC)Reply

Hi Nirmos. Unfortunately, we cannot help with technical questions at this talkpage. Please ask your question at m:Tech or one of the other locations documented in mw:Communication. Best regards, Quiddity (WMF) (talk) 20:20, 3 November 2025 (UTC)Reply

Contact Info and API Guidelines

In the API Usage Guidelines we say that the contact info in the User-Agent header should allow us to contact the operator of a bot. That's not quite clear from the User-Agent policy as it stands... It's still quite common for the User-Agent to contain contact info for the framework or library, which isn't useful. Point in case is https://github.com/goldsmith/Wikipedia/.

Current wording: If you run a bot, please send a User-Agent header identifying the bot with an identifier that isn't going to be confused with many other bots, and supplying some way of contacting you (e.g. a userpage on the local wiki, a userpage on a related wiki using interwiki linking syntax, a URI for a relevant external website, or an email address).

Proposed update: If you operate a bot, please send a User-Agent header identifying the bot in a way that isn't going to be confused with many other bots, and supplying some way of contacting you, the operator, in accordance with the API Usage Guidelines. The contact information should be given as an email address, a website, or a wiki user using the format (<project>; User:<name>), e.g. (wikipedia:de; User:DuesenBot).

The format we request for the contact info should match what we accept when extracting it for the wikitech:CDN/Backend_api. I'm not sure if interwiki link syntax is supported there - it's problematic because it's ambiguous ("en:User:DuesenBot" could refer to a page on English Wikipedia, or Wiktionary, or Wikisource...) -- DKinzler (WMF) (talk) 09:04, 25 March 2026 (UTC)Reply

Addendum: Being more specific about the format in which the contact info should be given would make sure that requests get classified as "compliant" by the CDN backend API as well. This is significant for API rate limits, since non-compliant clients fall to the lowest class of rate limits. DKinzler (WMF) (talk) 15:09, 26 March 2026 (UTC)Reply

 Done - Thanks for the clear before/after content. Quiddity (WMF) (talk) 21:44, 26 March 2026 (UTC)Reply
Excellent, thank you! DKinzler (WMF) (talk) 07:57, 27 March 2026 (UTC)Reply