RESTBase multiple pages with one request

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

RESTBase multiple pages with one request

Toni Hermoso Pulido-3
Hello,

is it already possible to retrieve data from different pages just by
using one request?

E.g by combining:
https://en.wikipedia.org/api/rest_v1/page/summary/Electron
and
https://en.wikipedia.org/api/rest_v1/page/summary/Dog

Thanks!

--
Toni Hermoso Pulido
http://www.cau.cat
http://www.similis.cc

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: RESTBase multiple pages with one request

Jaime Crespo
Hi, you can combine multiple pages with the "pipe" sign:

Check:
<https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=jsonfm&titles=Hillary_Clinton|Donald_Trump>
(change 'jsonfm' for 'json' on a real request)
There is a limit on the number of pages depending on your account
rights, but it is very helpful to avoid round-trip latencies for us in
high-latency places.


On Thu, Aug 4, 2016 at 9:34 AM, Toni Hermoso Pulido <[hidden email]> wrote:

> Hello,
>
> is it already possible to retrieve data from different pages just by
> using one request?
>
> E.g by combining:
> https://en.wikipedia.org/api/rest_v1/page/summary/Electron
> and
> https://en.wikipedia.org/api/rest_v1/page/summary/Dog
>
> Thanks!
>
> --
> Toni Hermoso Pulido
> http://www.cau.cat
> http://www.similis.cc
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l



--
Jaime Crespo
<http://wikimedia.org>

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: RESTBase multiple pages with one request

Toni Hermoso Pulido-3
Thanks Jaime, so it only works with Action (MediaWiki default) API so
far, doesn't it?

El 08/04/2016 a les 10:07 AM, Jaime Crespo ha escrit:

> Hi, you can combine multiple pages with the "pipe" sign:
>
> Check:
> <https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=jsonfm&titles=Hillary_Clinton|Donald_Trump>
> (change 'jsonfm' for 'json' on a real request)
> There is a limit on the number of pages depending on your account
> rights, but it is very helpful to avoid round-trip latencies for us in
> high-latency places.
>
>
> On Thu, Aug 4, 2016 at 9:34 AM, Toni Hermoso Pulido <[hidden email]> wrote:
>> Hello,
>>
>> is it already possible to retrieve data from different pages just by
>> using one request?
>>
>> E.g by combining:
>> https://en.wikipedia.org/api/rest_v1/page/summary/Electron
>> and
>> https://en.wikipedia.org/api/rest_v1/page/summary/Dog
>>
>>

--
Toni Hermoso Pulido
http://www.cau.cat
http://www.similis.cc 


_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: RESTBase multiple pages with one request

Jaime Crespo
Sorry, I am not sure 100%, if that is true, maybe creating a feature
request may help suggesting its implementation?

On Thu, Aug 4, 2016 at 3:09 PM, Toni Hermoso Pulido <[hidden email]> wrote:

> Thanks Jaime, so it only works with Action (MediaWiki default) API so
> far, doesn't it?
>
> El 08/04/2016 a les 10:07 AM, Jaime Crespo ha escrit:
>> Hi, you can combine multiple pages with the "pipe" sign:
>>
>> Check:
>> <https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=jsonfm&titles=Hillary_Clinton|Donald_Trump>
>> (change 'jsonfm' for 'json' on a real request)
>> There is a limit on the number of pages depending on your account
>> rights, but it is very helpful to avoid round-trip latencies for us in
>> high-latency places.
>>
>>
>> On Thu, Aug 4, 2016 at 9:34 AM, Toni Hermoso Pulido <[hidden email]> wrote:
>>> Hello,
>>>
>>> is it already possible to retrieve data from different pages just by
>>> using one request?
>>>
>>> E.g by combining:
>>> https://en.wikipedia.org/api/rest_v1/page/summary/Electron
>>> and
>>> https://en.wikipedia.org/api/rest_v1/page/summary/Dog
>>>
>>>
>
> --
> Toni Hermoso Pulido
> http://www.cau.cat
> http://www.similis.cc
>
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l



--
Jaime Crespo
<http://wikimedia.org>

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: RESTBase multiple pages with one request

Gabriel Wicke-3
Toni, we heavily use caching to speed up the REST API, so making individual
requests is the fastest way to retrieve content. You can use parallelism to
achieve your desired throughput, and with HTTP/2 all those parallel
requests can even share a single TCP connection. The request limit for the
API overall is 200 req/s, as documented in
https://en.wikipedia.org/api/rest_v1/?doc.

Hope this helps,

Gabriel

On Thu, Aug 4, 2016 at 2:20 PM, Jaime Crespo <[hidden email]> wrote:

> Sorry, I am not sure 100%, if that is true, maybe creating a feature
> request may help suggesting its implementation?
>
> On Thu, Aug 4, 2016 at 3:09 PM, Toni Hermoso Pulido <[hidden email]>
> wrote:
> > Thanks Jaime, so it only works with Action (MediaWiki default) API so
> > far, doesn't it?
> >
> > El 08/04/2016 a les 10:07 AM, Jaime Crespo ha escrit:
> >> Hi, you can combine multiple pages with the "pipe" sign:
> >>
> >> Check:
> >> <https://en.wikipedia.org/w/api.php?action=query&prop=
> revisions&rvprop=content&format=jsonfm&titles=Hillary_Clinton|Donald_Trump
> >
> >> (change 'jsonfm' for 'json' on a real request)
> >> There is a limit on the number of pages depending on your account
> >> rights, but it is very helpful to avoid round-trip latencies for us in
> >> high-latency places.
> >>
> >>
> >> On Thu, Aug 4, 2016 at 9:34 AM, Toni Hermoso Pulido <[hidden email]>
> wrote:
> >>> Hello,
> >>>
> >>> is it already possible to retrieve data from different pages just by
> >>> using one request?
> >>>
> >>> E.g by combining:
> >>> https://en.wikipedia.org/api/rest_v1/page/summary/Electron
> >>> and
> >>> https://en.wikipedia.org/api/rest_v1/page/summary/Dog
> >>>
> >>>
> >
> > --
> > Toni Hermoso Pulido
> > http://www.cau.cat
> > http://www.similis.cc
> >
> >
> > _______________________________________________
> > Wikitech-l mailing list
> > [hidden email]
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
>
>
> --
> Jaime Crespo
> <http://wikimedia.org>
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>



--
Gabriel Wicke
Principal Engineer, Wikimedia Foundation
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: RESTBase multiple pages with one request

Toni Hermoso Pulido-3
Thanks Gabriel, Jaime. It worked OK and it seems to be as fast as you
commented!

El 04/08/16 a les 23:34, Gabriel Wicke ha escrit:

> Toni, we heavily use caching to speed up the REST API, so making individual
> requests is the fastest way to retrieve content. You can use parallelism to
> achieve your desired throughput, and with HTTP/2 all those parallel
> requests can even share a single TCP connection. The request limit for the
> API overall is 200 req/s, as documented in
> https://en.wikipedia.org/api/rest_v1/?doc.
>
> Hope this helps,
>
> Gabriel
>
> On Thu, Aug 4, 2016 at 2:20 PM, Jaime Crespo <[hidden email]> wrote:
>
>> Sorry, I am not sure 100%, if that is true, maybe creating a feature
>> request may help suggesting its implementation?
>>
>> On Thu, Aug 4, 2016 at 3:09 PM, Toni Hermoso Pulido <[hidden email]>
>> wrote:
>>> Thanks Jaime, so it only works with Action (MediaWiki default) API so
>>> far, doesn't it?
>>>
>>> El 08/04/2016 a les 10:07 AM, Jaime Crespo ha escrit:
>>>> Hi, you can combine multiple pages with the "pipe" sign:
>>>>
>>>> Check:
>>>> <https://en.wikipedia.org/w/api.php?action=query&prop=
>> revisions&rvprop=content&format=jsonfm&titles=Hillary_Clinton|Donald_Trump
>>>
>>>> (change 'jsonfm' for 'json' on a real request)
>>>> There is a limit on the number of pages depending on your account
>>>> rights, but it is very helpful to avoid round-trip latencies for us in
>>>> high-latency places.
>>>>
>>>>
>>>> On Thu, Aug 4, 2016 at 9:34 AM, Toni Hermoso Pulido <[hidden email]>
>> wrote:
>>>>> Hello,
>>>>>
>>>>> is it already possible to retrieve data from different pages just by
>>>>> using one request?
>>>>>
>>>>> E.g by combining:
>>>>> https://en.wikipedia.org/api/rest_v1/page/summary/Electron
>>>>> and
>>>>> https://en.wikipedia.org/api/rest_v1/page/summary/Dog


--
Toni Hermoso Pulido
http://www.cau.cat
http://www.similis.cc

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l