aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/data.ts')
-rw-r--r--src/data.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/data.ts b/src/data.ts
new file mode 100644
index 0000000..116308d
--- /dev/null
+++ b/src/data.ts
@@ -0,0 +1,16 @@
+export let nobelPrizes: NobelPrize[] = [];
+export async function setNobelPrizes() {
+ nobelPrizes = (
+ await fetch("https://api.nobelprize.org/2.1/nobelPrizes").then((res) =>
+ res.json(),
+ )
+ ).nobelPrizes;
+}
+
+export interface NobelPrize {
+ awardYear: string;
+ category: { en: string; no: string; se: string };
+ dateAwarded: string;
+ prizeAmount: number;
+ prizeAmountAdjusted: number;
+}