Reputation: 317
I have a query that gets all the links in a Wikipedia article. The problem is that for some pages, it returns no link.
This Wikipedia article has many links on it. However, my query:
Returns only:
<?xml version="1.0"?>
<api>
<query>
<normalized>
<n to="Maramures County" from="Maramures_County"/>
</normalized>
<pages>
<page title="Maramures County" ns="0" pageid="3625444">
<links>
<pl title="Maramureș County" ns="0"/>
</links>
</page>
</pages>
</query>
</api>
If I run the same query for another article, likes "Moon", I get lots of results.
Returns
<?xml version="1.0"?>
<api>
<query-continue>
<links plcontinue="19331|0|JSTOR"/>
</query-continue>
<query>
<pages>
<page title="Moon" ns="0" pageid="19331">
<links>
<pl title="3753 Cruithne" ns="0"/>
<pl title="51st state" ns="0"/><pl title="Ablation" ns="0"/>
[ ... etc, etc ...]
Am I doing something wrong with the API or is this a bug?
Upvotes: 0
Views: 395
Reputation: 245028
Actually, the article Maramures County
is a redirect to Maramureș County
(notice the comma below s), which means it's technically an article with a single link to the redirect target.
To get the links, you can either use the name of the actual article:
Or you can use the redirects
parameter:
Upvotes: 5