I want to show some data from an API in a simple HTML div and it would be super helpful if anyone could help me with my code below. Here is the API: http://api.scb.se/OV0104/v1/doris/sv/ssd/START/JO/JO0601/SkordarL
Here is the JSON question that I want to send:
{
"query": [
{
"code": "Region",
"selection": {
"filter": "vs:RegionRiket99",
"values": []
}
},
{
"code": "Groda",
"selection": {
"filter": "item",
"values": [
"50"
]
}
},
{
"code": "ContentsCode",
"selection": {
"filter": "item",
"values": [
"JO0601L2"
]
}
},
{
"code": "Tid",
"selection": {
"filter": "item",
"values": [
"2000",
"2001",
"2002",
"2003",
"2004",
"2005",
"2006",
"2007",
"2008",
"2009",
"2010",
"2011",
"2012",
"2013",
"2014",
"2015",
"2016",
"2017"
]
}
}
],
"response": {
"format": "px"
}
}
What I have tried:
Here is my AJAX request so far:
$.ajax({
url: "http://api.scb.se/OV0104/v1/doris/sv/ssd/START/JO/JO0601/SkordarL",
type: "POST",
dataType:'json',
success: function () {
console.log();
},
error: function(error){
console.log("Error!", error);
}
});
Thanks for any advice!
//Chris