Question

How to paginate results in inline query API


Hi,

I would like to get results with pagination by using inline query API: 

POST/api/4.0/queries/run/{result_format}

 

I have researched a lot but couldn’t find any solution for this. I’m using API v4.

I saw there was a similar request 4 years ago, it wasn’t possible back then, isn’t this still possible?

I have more than 100k records and want to be able paginate them.

If this is not possible with this endpoint, is there any other workarounds with different endpoints?

 

 


This topic has been closed for comments

3 replies

Userlevel 2

@leobardor Thanks for your answer.

I couldn’t understand what you mean by “plain char API output”

Can you please clarify this for me? 

I mean, Is there any inconvenience to get all results in a (for instance)  pandas dataframe?

 

#PYTHON
import looker_sdk
import pandas a pd
from io import StringIO



sdk = looker_sdk.init31("/path/to/looker.ini")



look_results = sdk.run_look(look_id, "csv")

df = pd.read_csv(StringIO(look_results))

 

Best,

Leo

@leobardor Thanks for your answer.

I couldn’t understand what you mean by “plain char API output”

Can you please clarify this for me? 

Userlevel 2

Hi Mehmety!

 

As far I know, this is a Feature request (FR)

Upvote here 👇🏻

https://help.looker.com/hc/en-us/articles/4420198218387-Can-I-use-pagination-on-query-results-Community-

 

Just curious: Can't you handle that plain char API output in memory?

Best,

Leo