Skip to content

Downloading a large query fails with "Too Many Requests (RFC 6585) (HTTP 429)" #281

@sampoves

Description

@sampoves

Hello all,

When trying to query a full table in the Statistics Finland PxWeb database with pxweb, the data tables statfin_raku_pxt_156f and statfin_ras_pxt_12fy fail with "Too Many Requests". These tables are large, over 4 million data cells but what confuses me is that these downloads worked before. Is it possible that the database configuration has changed?

library(jsonlite)
library(pxweb)

pxweb_url <- "https://pxdata.stat.fi/PxWeb/api/v1/en/StatFin/raku/statfin_raku_pxt_156f.px"
# example 2
#pxweb_url <- "https://statfin.stat.fi:443/PxWeb/api/v1/en/StatFin/ras/statfin_ras_pxt_12fy.px"

content <- jsonlite::fromJSON(pxweb_url)
code <- content$variables$code
values <- content$variables$values
dims <- setNames(as.list(values), code)
pxq <- pxweb::pxweb_query(dims)

res <- pxweb::pxweb_get_data(pxweb_url, pxq)

I get the error message usually roughly at 67 %:

Error in pxweb_advanced_get(url = url, query = query, verbose = verbose) :
Too Many Requests (RFC 6585) (HTTP 429).

Link to the database configuration: https://statfin.stat.fi/PXWeb/api/v1/en/?config

I run pxweb_0.17.0 with R version 4.4.3 (2025-02-28 ucrt) for Windows.

Thank you for your time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions