We have quite a few properties related to the title and it's getting confusing. Not sure we can resolve it thought, but lemme document that:
- The summary endpoint result has title property that's the page title with spaces, not underscores.
- The feed response got title that uses underscores, and normalizedtitle that's got spaces.
- Trending endpoint got title that uses underscores, and normalizedtitle that's got spaces.
- Same for the on_this_day endpoint.
So it seems like only the summary endpoint itself uses the title as the display title not the normalized article key.
Since changing that would be backwards-incompatible, we need to accumulate more backwards-incompatible changes before doing this. The list is currently:
- For the summary endpoint, use underscores not spaces
- Use snake_case
- Add or modify normalized_title and display_title fields with an omitted namespace name (File:, User:, Special:, ...)
- Add a localized namespace field, namespace_title (User, Usuario, Special, Especial, ...)
- Update the API documentation
Also, @Niedzielski proposed to get rid of the namespace prefix for some of the keys:
https://commons.wikimedia.org/api/rest_v1/page/summary/File%3ACollage_of_Nine_Dogs.jpg Current: { ..., "title": "File:Collage of Nine Dogs.jpg", ... } Proposed: { ..., "title": "File:Collage_of_Nine_Dogs.jpg", // Use this when constructing a URL "normalized_title": "Collage of Nine Dogs.jpg", // Use this for plain text "display_title": "<strong>Collage of Nine Dogs.jpg</strong>", // Use this for WebViews "namespace_title": "File", // Use this when you want to include the namespace in the rich or plain text title ... }