Topic on Project:Support desk

How to get the 50,000th article created by time order via API?

2
Deletedaccount4567435 (talkcontribs)

Hi,

We just reached 50,000+ articles. We'd like to know which article is the 50,000th article been created in our wiki. Is there any way to get this info via API?

Thank you!

Bawolff (talkcontribs)

Not really (or at least not easily)

Best way is to probably use sql.

For all namespaces, do something like:

SELECT page_namespace, page_title from page order by page_id limit 49999,1;

if you want to limit it to some namespace like main (namespace 0) and say some custom namespace (lets say number 100), you'd do:

SELECT page_namespace, page_title from page where page_namespace in ( 0, 100 ) order by page_id limit 49999,1;

Sometimes people only count pages with links in them (depending on $wgArticleCountMethod) for that do something like:

SELECT page_namespace, page_title from page inner join pagelinks on pl_from=page_id where page_namespace in ( 0, 100 ) order by page_id group by page_namespace, page_title limit 49999,1;
Reply to "How to get the 50,000th article created by time order via API?"