If you want to get the table of contents, or, in other words, the list of sections of a page, you can use action=parse&prop=sections
:
http://en.wikipedia.org/w/api.php?action=parse&format=json&prop=sections&page=Ha%20Noi&redirects
Pergunta
I'm trying to get "Table" content of a page by wiki api query:
the "Table-Content" is block content numbered as 3
I tried this query, but it doesn't work
BTW, How can I get 2 very first section, instead of only one section with query like this Thanks
Solução 2
If you want to get the table of contents, or, in other words, the list of sections of a page, you can use action=parse&prop=sections
:
http://en.wikipedia.org/w/api.php?action=parse&format=json&prop=sections&page=Ha%20Noi&redirects
Outras dicas
If you want to get contents from a specific section you have to add §ion=4
, like this:
https://en.wikipedia.org/w/api.php?action=parse&format=json&prop=sections&page=Ha%20Noi&redirects§ion=4