我正在尝试使用以下代码从matomo api "Actions.getPageUrls“获取数据:
import requests
import pandas as pd
api_url="baseapi"
PARAMS = {'module': 'API',
'method':'Actions.getPageUrls',
'period' : 'range',
'date': '2019-01-01,2020-01-01',
'filter_limit' : '-1',
'idSite': '1',
'format': 'JSON',
'expanded' : '1',
'token_auth': "tocken"}
r = requests.post(url = api_url, params = PARAMS, verify=False)
print(r.url)
matomo_df = pd.DataFrame(r.json())
matomo_df.head()
matomo_df['label']
matomo_df = pd.DataFrame(r.json()[0]['subtable'])
matomo_df
但是,它只返回100行。
我想获得超过100行的数据。你能帮帮我吗?
发布于 2020-01-17 05:09:22
默认情况下,它被设置为仅返回100行,但是当您将'filter-limit‘设置为-1时,它将返回您将'filter-limit’参数设置为10000的所有rows.Can并尝试它。
https://stackoverflow.com/questions/59776537
复制相似问题