Search code examples
mediawikimediawiki-api

Getting talk page title using mediawiki API


Is there any way to fetch the talk page title of a given page title through MediaWiki API?

I know that I can get talkid using prop=info. But the problem is that there is no pageid for a talk page that does not exist yet. Also there are some obvious ways to get talk page title by adding a prefix to subject title, but it seems to me that they are all language/setup dependent...


Solution

  • leo's answer: So, given a title, that might not exist, you want to know what the talk page would be if the page was created, in a wiki with custom namespaces that you do not know? Then I would just have grabbed the list of all namespaces from the API: http://www.mediawiki.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces, and looked my prefix up there. The talk page namespace will be in NS+1.

    (Posted as community wiki so that this question isn't listed as unanswered.)