Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/api/EpiData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import DataSet, { DataGroup } from '../data/DataSet';
import EpiDate from '../data/EpiDate';
import EpiPoint from '../data/EpiPoint';
import { get } from 'svelte/store';
import { expandedDataGroups } from '../store';
import { apiKey, expandedDataGroups, storeApiKeys } from '../store';

// import DataSet from "../data/DataSet";
// import EpiDate from "../data/EpiDate";
Expand Down Expand Up @@ -260,6 +260,12 @@ export function importCOVIDcast({
api_key: string;
}): Promise<DataGroup | null> {
const title = `[API] COVIDcast: ${data_source}:${signal} (${geo_type}:${geo_value})`;
if (!api_key && get(storeApiKeys)) {
// if no API key was passed to this method, but we have a saved one, use it...
// this gets around access control and rate limiting when using an epivis "shared"
// link (an URL-encoded signal list, processed through `deriveLinkDefaults`).
api_key = get(apiKey);
}
return loadDataSet(
title,
'covidcast',
Expand Down