On Sunday, March 18, 2018, Tal Barda <412tal412@gmail.com> wrote:
> Hi! 
> I have a question regarding the random articles generation in the API.
> Let's say I'm using this URL to retrieve two random articles: 
> https://en.wikipedia.org/w/api.php?format=xml&action=query&generator=random&grnlimit=2&grnnamespace=0
> I got an API response which contains articles A and B in this order:
> 1. A
> 2. B
> Is there a chance (I know it's very small, but it's just for my understanding), that I'll get the exact articles but in the opposite order? Like this:
> 1. B
> 2. A
> I'd like to know whether there is certain order for the random articles in the API response, or it's also random. 
> Thanks!
>
>
>
>

Only if there is only 2 articles in wiki.

There is a deterministic "random" order of pages (on creation, each page is associated with a random number). The random api module picks a random place in this ordering to start, and then returns results in order of their random number.

--
brian