Last modified: 2013-05-13 22:08:14 UTC
There is some information missing from result of the API call to action=parse&prop=links Example: foo]]%20[[API:Query|bar]]%20[[API:Query|other]]%20[http://www.example.com/%20baz">https://en.wikipedia.org/w/api.php?action=parse&prop=links&format=json&text=[[foo]]%20[[API:Query|bar]]%20[[API:Query|other]]%20[http://www.example.com/%20baz] The result of such call contains link list, but there is missing information: - The text for each link would be useful for some bot actions - The offset of the link should also be given Each link may appear multiple times in the parsed wiki page, so the above missing information would need to be repeated for each instance of the link. For the JSON format the result for the above example would be: {"parse":{"title":"API","links":[{"ns":0,"*":"Foo","exists":"",[{offset:0}]},{"ns":0,"*":"API:Query"},[{offset:8,text="bar"},{offset:26,text="other"}]]}}
(the above link didn't rendered correctly, so I try to post an encoded one) https://en.wikipedia.org/w/api.php?action=parse&prop=links&format=json&text=%5B%5Bfoo%5D%5D%20%5B%5BAPI:Query|bar%5D%5D%20%5B%5BAPI:Query|other%5D%5D%20%5Bhttp%3A%2F%2Fwww.example.com/%20baz%5D
It's already enough trouble trying to get the offsets for sections out of the parser (see bug 25203). Trying to manipulate the parser to extract position and piped text for every wikilink is probably not going to happen. If you want that level of parsing, look into parsing the wikitext in your client instead.