API error

31 views
Skip to first unread message

katarin...@skogsstyrelsen.se

unread,
Mar 7, 2025, 5:24:51 AMMar 7
to pcaxis
Hi,
Can someone help me to underständ this error message I got from one of our users.
He cannot use the API,

403 Forbidden

The request contained valid data and was understood by the server, but the server is refusing action. This may be due to the user not having the necessary permissions for a resource or needing an account of some sort, or attempting a prohibited action (e.g. creating a duplicate record where only one is allowed). This code is also typically used if the request provided authentication by answering the WWW-Authenticate header field challenge, but the server did not accept that authentication. The request should not be repeated.

Hans Baumgartner

unread,
Mar 10, 2025, 3:14:06 AMMar 10
to pca...@googlegroups.com

Hi,

API limitations (an example):

Query the API for its configuration: https://pxdata.stat.fi/PXWeb/api/v1/fi/?config



Status codes (error messages):

        200 - OK

        404 - errors in syntax of the query or POST URL not found.

        403 - blocking when querying for large data sets. The API limit is by default 100,000 cells so everyone can use it.

        429 - Too many queries within a minute. The API limit is now 30 queries within 10 seconds.

        503 - Time-out after 60 seconds. It may turn on, when extracting large XLSX datasets.

                  (We do not recommend that).

This setting can be changed in PxWeb admin…

Hans

 

 

Lähettäjä: pca...@googlegroups.com <pca...@googlegroups.com> Puolesta katarin...@skogsstyrelsen.se
Lähetetty: perjantai 7. maaliskuuta 2025 12.25
Vastaanottaja: pcaxis <pca...@googlegroups.com>
Aihe: API error

--
You received this message because you are subscribed to the Google Groups "pcaxis" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pcaxis+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pcaxis/eb6425c4-df3b-4ca6-9326-6c82437a3823n%40googlegroups.com.

katarin...@skogsstyrelsen.se

unread,
Mar 10, 2025, 3:30:21 AMMar 10
to pca...@googlegroups.com

Thank you Hans!

 

What do you recommend? Is it a bad idea to increase the number of cells?

 

Best regards,

Katarina

--
You received this message because you are subscribed to a topic in the Google Groups "pcaxis" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pcaxis/fBj0dI1nx6E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pcaxis+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pcaxis/AS4PR10MB60401D4CBB5CE0D5A703AAFB91D62%40AS4PR10MB6040.EURPRD10.PROD.OUTLOOK.COM.

Hans Baumgartner

unread,
Mar 10, 2025, 4:12:18 AMMar 10
to pca...@googlegroups.com

Hi,

We have upped it to 120 000 cells … it still works fine!

This might help your customer:
How to use PxAPI with R video on Youtube:

https://www.youtube.com/watch?v=lWMS22XCwrE

More can be found here:
https://github.com/rOpenGov/pxweb



 

Also remember to protect your admin interfaces by adding user IPs to Settings/Administration
to filter out any unwanted actors.

THIS SHOULD BE DONE BY A PROFESSIONAL!

Use IP filter

Defines if IP filter shall be applied when someone tries to login to the PxWeb Administration tool and the Administration API.


If IP filter is turned on it will only be possible to login to the PxWeb Administration from a computer having an IP address specified in the IP addresses list.

Notice: It is strongly recommended that this setting is set to Yes.


IP addresses

This is List of IP addresses with permission to login to the PxWeb Administration tool and the Administration API. It is possible to add as many IP addresses to the list as needed.

It is not necessary to specify a complete IP address, it is possible to just specify the start of an IP address.

Example: If 192.168 is added to the IP addresses list all IP addresses starting with 192.168 can login to the PxWeb Administration tool


Hans

 

Lähettäjä: pca...@googlegroups.com <pca...@googlegroups.com> Puolesta katarin...@skogsstyrelsen.se
Lähetetty: maanantai 10. maaliskuuta 2025 9.30
Vastaanottaja: pca...@googlegroups.com
Aihe: Sv: [EXTERNT] VS: API error

Reply all
Reply to author
Forward
Message has been deleted
0 new messages