This relates to slightly different strategies employed by the the APIs
The first one, which is part of the Action API (api.php), applies less
filtering. See WikimediaPageViewService.php
<https://github.com/wikimedia/mediawiki-extensions-PageViewInfo/blob/master/includes/WikimediaPageViewService.php#L46>
for a starting point.
The second one, which is part of the RESTbase API (/api/rest_v1), applies
more custom filtering. See the most-read.js
<https://phabricator.wikimedia.org/diffusion/GMOA/browse/master/lib/feed/most-read.js>
file
to which Michael linked.
-Adam
On Fri, Apr 7, 2017 at 5:02 AM, Anandroid Inc <anandrdinc(a)gmail.com> wrote:
Hi Team,
Thanks a lot for your support and quick responses.
As per all the suggestions you gave for my query, I found below two apis
which solves my purpose,
But I see both queries ask for todays most viewed pages on wikipedia but
they are returning different results.
Request you to please help me on this.
1)
https://en.wikipedia.org/w/api.php?action=query&format=
json&prop=extracts%7Cinfo%7Cpageimages%7Cpageviews%
7Cpageterms%7Cpageprops%7Crevisions&generator=mostviewed&exchars=512&
exlimit=max&exintro=1&explaintext=1&exsectionformat=
plain&inprop=url&pithumbsize=640&pilimit=max&wbptterms=
description%7Calias%7Clabel&gpvimlimit=50&pvipdays=1
<https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts%7Cinfo%7Cpageimages%7Cpageviews%7Cpageterms%7Cpageprops%7Crevisions&generator=mostviewed&exchars=512&exlimit=max&exintro=1&explaintext=1&exsectionformat=plain&inprop=url&pithumbsize=640&pilimit=max&wbptterms=description%7Calias%7Clabel&gpvimlimit=100&pvipdays=1>
2)
https://en.wikipedia.org/api/rest_v1/feed/featured/2017/04/07
On 07-Apr-2017, at 3:43 AM, Adam Baso <abaso(a)wikimedia.org> wrote:
For the action API I think you're looking for an extra property,
*pageviews*. Maybe something like this:
https://en.wikipedia.org/wiki/Special:ApiSandbox#action=
query&format=json&prop=extracts%7Cinfo%7Cpageimages%
7Cpageviews%7Cpageterms%7Cpageprops%7Crevisions&
generator=mostviewed&exchars=512&exlimit=max&exintro=1&
explaintext=1&exsectionformat=plain&inprop=url&pithumbsize=
640&pilimit=max&pvipdays=8&wbptterms=description%7Calias%
7Clabel&gpvimlimit=20
On Thu, Apr 6, 2017 at 4:44 PM, Anandroid Inc <anandrdinc(a)gmail.com>
wrote:
++Michael
On 07-Apr-2017, at 3:09 AM, Anandroid Inc <anandrdinc(a)gmail.com> wrote:
Hi Michael,
Thanks for your quick response.
This is very helpful, exactly what I was looking for.
Thanks,
Anand
On 07-Apr-2017, at 12:08 AM, Michael Holloway <mholloway(a)wikimedia.org>
wrote:
Hi Anand,
It sounds like the REST API's featured feed endpoint
<https://en.wikipedia.org/api/rest_v1/#!/Feed/aggregatedFeed> provides
what you're looking for.
For example:
https://en.wikipedia.org/api/rest_v1/feed/featured/2017/04/0
6 (see the content under the "mostread" key).
Under the hood, titles are obtained from the Pageview API
<https://wikitech.wikimedia.org/wiki/Analytics/PageviewAPI> and then
supplementary information for our desired titles is obtained from the REST
API's page summary endpoint
<https://en.wikipedia.org/api/rest_v1/#!/Page_content/get_page_summary_title>.
That would be the easiest way to go if you'd like to go in a slightly
different direction from what's provided in our featured feed endpoint.
If you'd like, you can view the implementation for the "mostread" section
of our aggregated feed endpoint here:
https://phabricator.wikimedia.org/diffusion/GMOA/browse/mast
er/lib/feed/most-read.js
Please note that as of now the REST API endpoints are officially
designated as unstable.
Best,
Michael
On Thu, Apr 6, 2017 at 2:19 PM, Anandroid Inc <anandrdinc(a)gmail.com>
wrote:
Hi Team,
Thanks for the great api provided for all the wiki info.
I am looking for a combination of right parameters which will return me
most viewed pages with the page url, article snippet, thumbnail image url.
Hope you can help with this.
Thanks,
Anand
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api