ערב טוב.
אני מנסה לקבל נתונים מהאתר החדש של בנק ישראל של שערי חליפין, אני שולח בקשה עם תאריכים ומטבע ומקבל חזרה את הנתונים הבאים:
{
"meta": {
"id": "IDREF2232d456-2a97-43fd-8dda-921bebed16c8",
"prepared": "2023-01-05T15:30:43",
"test": false,
"datasetId": "a8e45406-dcaf-4418-a21d-3228709d25f0",
"sender": {
"id": "UNKNOWN"
},
"receiver": {
"id": "guest"
},
"links": [{
"rel": "self",
"href": "/data/dataflow/BOI.STATISTICS/EXR/1.0/RER_USD_ILS?endperiod=2023-01-06&format=sdmx-json&startperiod=2023-01-01",
"uri": "https://raw.githubusercontent.com/sdmx-twg/sdmx-json/develop/structure-message/tools/schemas/1.0/sdmx-json-structure-schema.json"
}]
},
"data": {
"dataSets": [{
"links": [{
"rel": "dataflow",
"urn": "urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=BOI.STATISTICS:EXR(1.0)"
}],
"action": "Information",
"series": {
"0:0:0:0:0:0": {
"attributes": [0, 0, 0, 0, 0, null],
"observations": {
"0": ["3.532"],
"1": ["3.527"],
"2": ["3.529"]
}
}
}
}],
"structure": {
"links": [{
"rel": "dataflow",
"urn": "urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=BOI.STATISTICS:EXR(1.0)"
}, {
"rel": "datastructure",
"urn": "urn:sdmx:org.sdmx.infomodel.datastructure.DataStructure=BOI.STATISTICS:EXR(1.0)"
}],
"name": "שערי חליפין",
"names": {
"he": "שערי חליפין"
},
"dimensions": {
"dataset": [],
"series": [{
"id": "SERIES_CODE",
"name": "שם סדרה",
"keyPosition": 0,
"role": null,
"values": [{
"id": "RER_USD_ILS",
"name": "שער יציג דולר ארה\"ב - שקל"
}]
}, {
"id": "FREQ",
"name": "תדירות",
"keyPosition": 1,
"role": null,
"values": [{
"id": "D",
"name": "יומי"
}]
}, {
"id": "BASE_CURRENCY",
"name": "מטבע בסיס",
"keyPosition": 2,
"role": null,
"values": [{
"id": "USD",
"name": "דולר ארה\"ב"
}]
}, {
"id": "COUNTER_CURRENCY",
"name": "מטבע נגדי",
"keyPosition": 3,
"role": null,
"values": [{
"id": "ILS",
"name": "ש\"ח"
}]
}, {
"id": "UNIT_MEASURE",
"name": "יחידות מידה",
"keyPosition": 4,
"role": null,
"values": [{
"id": "ILS",
"name": "ש\"ח"
}]
}, {
"id": "DATA_TYPE",
"name": "סוג נתון",
"keyPosition": 5,
"role": null,
"values": [{
"id": "OF00",
"name": "שער יציג"
}]
}],
"observation": [{
"id": "TIME_PERIOD",
"name": "Time period",
"description": "The period of time or point in time to which the measured observation refers.",
"keyPosition": 6,
"role": "time",
"values": [{
"start": "2023-01-03T00:00:00",
"end": "2023-01-03T23:59:59",
"id": "2023-01-03",
"name": "2023-01-03"
}, {
"start": "2023-01-04T00:00:00",
"end": "2023-01-04T23:59:59",
"id": "2023-01-04",
"name": "2023-01-04"
}, {
"start": "2023-01-05T00:00:00",
"end": "2023-01-05T23:59:59",
"id": "2023-01-05",
"name": "2023-01-05"
}]
}]
},
"attributes": {
"dataset": [],
"series": [{
"id": "DATA_SOURCE",
"name": "מקור נתונים",
"relationship": {
"dimensions": ["SERIES_CODE", "FREQ", "BASE_CURRENCY", "COUNTER_CURRENCY", "UNIT_MEASURE"]
},
"role": null,
"values": [{
"id": "BOI_MRKT",
"name": "בנק ישראל - חטיבת השווקים"
}]
}, {
"id": "TIME_COLLECT",
"name": "אופן חישוב בתקופת זמן",
"relationship": {
"dimensions": ["SERIES_CODE", "FREQ", "BASE_CURRENCY", "COUNTER_CURRENCY", "UNIT_MEASURE"]
},
"role": null,
"values": [{
"id": "V",
"name": "אחר"
}]
}, {
"id": "CONF_STATUS",
"name": "סיווג סודיות",
"relationship": {
"dimensions": ["SERIES_CODE", "FREQ", "BASE_CURRENCY", "COUNTER_CURRENCY", "UNIT_MEASURE"]
},
"role": null,
"values": [{
"id": "F",
"name": "לא סודי"
}]
}, {
"id": "PUB_WEBSITE",
"name": "פרסום באתר",
"relationship": {
"dimensions": ["SERIES_CODE", "FREQ", "BASE_CURRENCY", "COUNTER_CURRENCY", "UNIT_MEASURE"]
},
"role": null,
"values": [{
"id": "Y",
"name": "כן"
}]
}, {
"id": "UNIT_MULT",
"name": "מכפיל יחידות",
"relationship": {
"dimensions": ["SERIES_CODE", "FREQ", "BASE_CURRENCY", "COUNTER_CURRENCY", "UNIT_MEASURE"]
},
"role": null,
"values": [{
"id": "0",
"name": "יחידות"
}]
}, {
"id": "COMMENTS",
"name": "הערות",
"relationship": {
"dimensions": ["SERIES_CODE", "FREQ", "BASE_CURRENCY", "COUNTER_CURRENCY", "UNIT_MEASURE"]
},
"role": null,
"values": []
}],
"observation": []
}
}
}
}
כעת אני מנסה לחלץ את הנתונים שנמצאים בערך "observations" (ליתר דיוק את הערך האחרון שיש שם), אני ממיר את הJSON עם JsonConverter.ParseJson אבל אני לא מצליח לגשת לנתונים האלו.
ניסיתי משהו כמו ("data")("dataSets")("series")("0:0:0:0:0:0")("observations")("2"), אבל חוזר לי שגיאה על זה.
מישהו יודע מה אני צריך לכתוב בשביל להגיע אליהם?
תודה!