Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8849423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:38:53+00:00 2026-06-14T12:38:53+00:00

there is something strange going on with the Shopify API, I cannot understand what

  • 0

there is something strange going on with the Shopify API, I cannot understand what I am doing wrong.

I’d like to get from Shopify a list of all the products so I use the following code:

def get_all_products_from_shopify
  limit = 250
  all_products = Array.new

  self.connect_to_store
  products = ShopifyAPI::Product.find(:all, :params => {:limit => limit})

  all_products = all_products.concat products
  puts products.length
  while products.length == limit do
    since_id = products.last.id
    products = ShopifyAPI::Product.find(:all, :params => {:limit => limit, :since_id => since_id})
    all_products = all_products.concat products
  end
  ShopifyAPI::Base.site = nil
  return all_products
end

The issue is that I have 251 products on Shopify but with this method I retrieve an array of products that has a size of 277 elements.
Why?

Also if I do:

products = ShopifyAPI::Product.count
> 251

products = ShopifyAPI::Product.find(:all, :params => {:limit => limit})
products.count
>250
since_id = products.last.id
ShopifyAPI::Product.count(since_id: since_id)
>26

Can anybody tell me what am I doing wrong?

Thanks,
Augusto

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:38:55+00:00Added an answer on June 14, 2026 at 12:38 pm

    By default products are returned in ascending order by title in the product list API. Instead of omitting the :since_id param for the first page of results, use :since_id => 0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there something like API built atop the standard ProcessBuilder for calling system programs?
I think I've been suffering from a very strange bug. There might be something
There is something strange going on. I am using Zend Framework on a subfolder
Is there something akin to the .NET xsd.exe for java - generating classes from
Is there something like serialize/unserialize PHP functions in jQuery? These functions return a string
Is there something like die in JavaScript? I've tried with break, but doesn't work
Is there something like the following in Apache Common Lang or Spring Utils or
Is there something in the Android developer guidelines that disuades developers from providing the
Is there something like SESSION in Windows application? I want to store a few
Something very strange is going on with a custom view containing a TextView .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.