Get more than 50 products in since_id call

270 views
Skip to first unread message

Blaise

unread,
Jun 10, 2011, 11:20:45 AM6/10/11
to shopify-api
HI,

I'm trying to retrieve all products from a store with products more
than 250 (say 1000). I make the first api call below using PHP to get
the first 250 products

$url =....../admin/products.xml?limit=250"; (authentication is
ok)

to get the next 250, I follow with another call using the since_id, as
below;

$url2= ..../admin/products.xml?since_id=id";(authentication is ok)

but the since_id call is only returning 50 products which is the
default, but I want a way to increase the products to 250 with the
since_id call.

Is there a way to work around this?

thanks

David Underwood

unread,
Jun 10, 2011, 11:27:26 AM6/10/11
to shopi...@googlegroups.com
Yes, you can simply set the limit parameter like you did on the first call. It'll work just the same :)

-David Underwood
 Developer Advocate, Shopify
 1-888-746-7439 x771

Edward Ocampo-Gooding

unread,
Jun 10, 2011, 11:28:15 AM6/10/11
to shopi...@googlegroups.com
What happens when you do:

    $url2= ..../admin/products.xml?since_id=id&limit=250";


Edward Ocampo-Gooding
Shopify Developer Advocate

Blaise

unread,
Jun 10, 2011, 12:22:55 PM6/10/11
to shopify-api
Hi Edward,

I have tried the $url2= ..../admin/products.xml?since_id=id&limit=250
and $url2= ..../admin/products.xml?since_id=id?lmite=250 but both
returning on 50 products making. So total products retrieved are 300
instead of 500

Is there something i'm doing wrong.



On Jun 10, 3:28 pm, Edward Ocampo-Gooding <edw...@jadedpixel.com>
wrote:

David Speake

unread,
Jun 10, 2011, 12:33:25 PM6/10/11
to shopi...@googlegroups.com
I've had this problem before with PHP and fixed it by replacing & with
&amp; in the URL.

Good luck.

Dave

David Speake

unread,
Jun 10, 2011, 12:36:36 PM6/10/11
to shopi...@googlegroups.com
I just read the whole thread again, and you could use page=X could you?

> $url2= ..../admin/products.xml?limit=250&page=2

I've used that before with a combination of a count call beforehand,
and a for loop afterwards.

On Jun 10, 2011, at 11:22, Blaise <blai...@gmail.com> wrote:

Blaise

unread,
Jun 10, 2011, 1:16:55 PM6/10/11
to shopify-api
Hey David,

wow!! you saved my day and your last suggestion ($url2= ..../admin/
products.xml?limit=250&page=2) did the magic.

thanks so much and will let you know if I encounter any issue with
this call.


On Jun 10, 4:36 pm, David Speake <da...@verycleverstuff.co.uk> wrote:
> I just read the whole thread again, and you could use page=X could you?
>
> > $url2= ..../admin/products.xml?limit=250&page=2
>
> I've used that before with a combination of a count call beforehand,
> and a for loop afterwards.
>
Reply all
Reply to author
Forward
0 new messages