Giter VIP home page Giter VIP logo

Comments (5)

eduaero avatar eduaero commented on July 29, 2024 5

I have done it on the following way. I hope that someone can find it useful:

page=0
while True:
page=page+1
str=("products?page=%d") % page
r=wcapi.get(str)
r_text=r.text
parsed = json.loads(r_text)
file=json.dumps(parsed, indent=4)
file_json = json.loads(file)
if file_json.len()<10:
break

from wc-api-python.

jlegido avatar jlegido commented on July 29, 2024

Try this:

wcapi.get('products?filter[limit]=100')

As far as I know it will deppend on which version of the Woocommerce API are you using.

Cheers.

from wc-api-python.

eduaero avatar eduaero commented on July 29, 2024

Thank you jlegido

What you have written it is not recognized.

However it would do the same as:
wcapi.get('products?per_page=100')

My problem is that I have, lets say 300 products and the maximum products per_page is 100.
wcapi.get('products?per_page=200') --> Do not work as 200>100

Furthermore I cannot ask for:

wcapi.get('products?per_page=100?page=2')
As it tells me that after per_page= everything should be an integer.

Any help would be really really welcome as I really need to get all the products downloaded.

Thank you very much 👍

from wc-api-python.

sambarza avatar sambarza commented on July 29, 2024

Just for share, the second ?:
wcapi.get('products?per_page=100?page=2')

should be &:
wcapi.get('products?per_page=100&page=2')

from wc-api-python.

claudiosanches avatar claudiosanches commented on July 29, 2024

This limit does not come from this library, this limit is from WP REST API.

from wc-api-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.