Forum:API: Request a JSON tree of Sections of a page?

Greetings, as the title suggest, I wish to ask how to retrieve a JSON tree of Section names of a given page.

You see, I wish to have function  to return the section content by passing a sectionName. But i was unable to find anyway from api.php to retrieve it by directly passing a non-number sectionName (or I wasn't looking good enough, anyway).

However the only loop hole i could think of from the API was looping the  from 1 till undefined then parsing the first line containing the inside of ==  == until it could match sectionName. It was good but I think this would be too congestive as any section could contain 100,000+ characters, thereafter just "dumping it" when it finds that it wasn't it, then moving on to the next section with a possible 100,000+ characters - again? As with any developer, I want AMAP to consume as little bandwidth as possible as I expect this function to be used several times in a page when the need arises.

So, basically my question is how to retrieve a (soft of) JSON tree of Section names (via API) so my app will use that to loop and compare the section names, then ultimately once found, use a 'reference number'  to retrieve the contents - just once. Or any other non-congestive solution would be good. ^^

Thank you in advance - ^^ Fe2+ | talk 05:38, December 18, 2011 (UTC)


 * Although you might get an answer from the Wikia community, it might be better to use Special:Contact/general and ask there or maybe on the MediaWiki support desk. -- Fandyllic (talk &middot; contr) 19 Dec 2011 2:01 PM Pacific


 * As far as I know, what you're trying to do is not possible on Wikia. I don't think MediaWiki stores section names in the SQL database, so I doubt you'd be able to fetch only one particular section based on its name. You could fetch the full page text and parse it, which will, as far as I know, consume the least amount of bandwidth possible to accomplish the task. You may want to restructure your application so that it doesn't need the name of the section.