REST API change limit rows /api/dataset


#1

Hi All!

I just started to use MetaBase last week. Yet I managed to retrieve data via API from R.

But now I am facing to problem of the limit of rows that the API returns (10.000). Is there a way to change this limitation?

Once connected in my metabase session (metabase_session) the piece of code used to get the results from a query is:

data <- list( ‘database’= DB_ID, ‘native’= list(‘query’= query), ‘type’= ‘native’)
data_json <- jsonlite::toJSON(data, auto_unbox=TRUE)

req <- httr::POST(paste0(metabase_session$base_url, "/dataset",""),
                  httr::add_headers(
                    "Content-Type" = "application/json",
                    "X-Metabase-Session" = metabase_session$token
                  ),
                  body = data_json
)

I have tried to add in data_json ‘limit’=15000 but didn’t manage to get more than 10k results.

Any help would be apreciated,


#2

Hi @Roc
Currently it’s a hard limit - as far as I know - you would need to modify source code to change it.
But if you download, then the limit should be 1 million rows:
https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#post-apidatasetexport-format


#3

Thnks for the solution, yet we have tried and didn’t worked (we didn’t spend much time tring to change the code for the api).

We have managed to do as desired by connecting directly to the DataBase.

Regards,