Skip to content

Instantly share code, notes, and snippets.

View joerj123's full-sized avatar

Joe Rinaldi Johnson joerj123

View GitHub Profile
@rseabrook
rseabrook / paginate-shopify-api.md
Created October 16, 2019 19:00
How to iterate over all products using the Python Shopify API wrapper

How to iterate over Shopify API results

Shopify switched their API to "cursor-based pagination" in July of 2019. This eliminated the page parameter that made it simple and obvious how to get multiple pages of results.

The Python wrapper for the Shopify API actually makes it quite difficult to page through results now. The API responds with next and previous URLs via the response headers that can be used to retrieve different pages of results, but the python wrapper actually drops these headers. There is a pull request waiting to be merged that will give access to convenient next and previous methods. In the meantime, maybe this will be useful to someone else...

Requirements

  • Shopify private app with API key and password
@kamermans
kamermans / mysql_countries.sql
Created December 7, 2011 04:43
MySQL Dump - continents and countries with 2 and 3 char codes, names and full names - Braintree compatible as of Dec 2011
/**
* Continents and Countries MySQL Tables compiled from Wikipedia, Braintree Payments documentation
* and a couple other places I don't recall at the moment. This data is compatible with the Braintree
* Payment API as of Dec 2011
*
* Compiled by Steve Kamerman, 2011
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------