#ArjunK

1 messages · Page 1 of 1 (latest)

hazy birchBOT
fierce lion
#

Hi 👋

What API? Are you using Stripe's Python package?

short widget
#

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

fierce lion
#

What API?

#

As well as code snippets in Python for how to retrieve list data

short widget
#

stripe charges

#

df_charge = extract_data(stripe.Charge.list(limit=100))

#

I have already used just confused how to get only first 1000 records

fierce lion
#

What do you mean by the "first 1000". Our List APIs return newest first records

short widget
#

ok, but websitesite doesn't have example code.

fierce lion
#

Pagination is a common topic in API interactions. You should be able to find plenty of examples on the web