This repository was archived by the owner on Jan 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Aabol, Simen Tvete edited this page Nov 20, 2023
·
44 revisions
- GPTs Instructions for api v.2
- GPTs Description
- GPTs Swagger.json
- GPTs Knowledge: Vocabulary for tables
Eksempel-kall til databasen
Oppskrift: Starting with the fish: https://data.qa.ssb.no/pxapi2-beta/api/v2/tables/03024
Look at the response from : https://data.qa.ssb.no/pxapi2-beta/api/v2/tables/03024/metadata?lang=no
For each object in the variable array:
Construck a string on the form: valueCodes[<id property>]=<code property of first item in the value array>,<same for the second item in the value array> and so on
For example:
{
"id": "VareGrupper2",
"label": "varegruppe",
"type": "RegularVariable",
"elimination": false,
"values": [
{
"code": "01",
"label": "Fersk oppalen laks"
},
{
"code": "02",
"label": "Frosen oppalen laks"
}
]
}
Yields:
valueCodes[VareGrupper2]=01,02
Decide on language and outputformat:
lang=no&outputformat=json
Join these together:
https://data.qa.ssb.no/pxapi2-beta/api/v2/tables/03024/data?lang=no&outputformat=json&valueCodes[VareGrupper2]=01,02&valueCodes[ContentsCode]=Vekt,Kilopris&valueCodes[Tid]=2023U14,2023U15,2023U16,2023U17,2023U18,2023U19