#ArjunK
1 messages · Page 1 of 1 (latest)
Hi 👋
What API? Are you using Stripe's Python package?
def extract_data(api_data):
data_list = pd.DataFrame()
for item in api_data.auto_paging_iter():
flatten = pd.json_normalize(item, sep="_")
data_list = data_list.append(flatten, sort=True)
return data_list
yes, stripe python, above code will extract all the data but I don't need all
just need 1000 records
What API?
We have all our endpoints listed here: https://stripe.com/docs/api
As well as code snippets in Python for how to retrieve list data
stripe charges
df_charge = extract_data(stripe.Charge.list(limit=100))
I have already used just confused how to get only first 1000 records
What do you mean by the "first 1000". Our List APIs return newest first records
For 1000 you will need to paginate the list response https://stripe.com/docs/api/pagination
ok, but websitesite doesn't have example code.
Pagination is a common topic in API interactions. You should be able to find plenty of examples on the web