How to get all wikipedia accounts made within timeframe?

34 Views Asked by At

I'm trying to replicate this paper, where they use a random sample of user accounts made between September 9th, 2010 and February 14th, 2011. How can I use the wikipedia API to get this data?

I can't seem to figure out how to use their API's usercontribs to do this (or anything else)

1

There are 1 best solutions below

0
InSync On

list=usercontribs provides, well, user contributions. What you need is list=logevents.

The corresponding action is newusers/create, for "creation by anonymous user" (not newusers/create2, which means "creation by registered user").

Since you seem to want only the usernames, leprop should be set to user. lestart and leend are where you specify the timestamps; note that the first must be later than the second when ledir is older (the default) and vice versa.

https://en.wikipedia.org/w/api.php
?action=query
&format=json
&formatversion=2

&list=logevents
&leprop=user
&leaction=newusers%2Fcreate
&lestart=2011-02-14T23%3A59%3A59.000Z
&leend=2010-09-09T00%3A00%3A00.000Z

Try it using the API sandbox.

Each response will have a lecontinue token that you may use in your next request.