Page MenuHomePhabricator

Appending ".json" to an entity url should work (Feature Request)
Open, LowestPublic


For example, to view the JSON of:

You should be able to visit:

Currently you can find the json at: which is practically impossible to find and is not linked in the "Tools" sidebar or anywhere else I can find. I saw somewhere that "content negotiation" might be possible to view the json format, but it is not practical in many use cases.

Event Timeline

Pengo created this task.Dec 31 2015, 10:52 PM
Pengo raised the priority of this task from to Needs Triage.
Pengo updated the task description. (Show Details)
Pengo added a project: Wikidata.
Pengo added a subscriber: Pengo.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 31 2015, 10:52 PM
hoo triaged this task as Low priority.Jan 1 2016, 11:52 PM
hoo added a subscriber: hoo.

This already works for (that's the URL found under "Concept URI" in the sidebar with .json appended).

See also T66515.

Pengo added a comment.Jan 2 2016, 3:40 AM

I stand by my "practically impossible to find" comment.

What do you want exactly? This looks like a WORKSFORME.

Pengo added a comment.Jan 3 2016, 4:12 AM

What do you want exactly?

To be able to add ".json" to a url in your browser's url bar.

If you visit: (/entity)

You will be redirected to: (/wiki)

So I'm not sure how anyone would find the working json url of:  (/entity .json)

Instead, you'll probably find this: (* /wiki .json)

with the message "This entity does not exist"

Why not make it work the same way as the "/entity .json" url? i.e. also
redirect it to

Lydia_Pintscher lowered the priority of this task from Low to Lowest.Feb 7 2018, 4:01 PM
thiemowmde added a subscriber: thiemowmde.

This ticket appears to be some kind of subticket of T109420: [Story] Make exports formats more visible. Both are about discoverability.

Personally I support what is asked for here. When I'm on a wiki page like
and I add ".json" at the end, I expect the resulting URL
to not show a "page not found" error as it does now, but to redirect to

Pengo added a comment.May 17 2018, 3:31 AM

Thanks thiemowmde for drawing the connection. I've added this as a child task in case someone suddenly decides to write a couple of nginx regex rewrite rules to make this happen.

cscott added a subscriber: cscott.Oct 11 2018, 7:02 PM

...and adding .jsonld at the end should also work, right?

...and adding .jsonld at the end should also work, right?

Yes please. I hope the current open patch in T44063 will take care of that