Skip to content

Commit

Permalink
api
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharth0248 committed Sep 12, 2024
1 parent b01ae96 commit aec45ed
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 18 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"# Function to fetch CSV data for a station with a limit parameter\n",
"def get_station_data_csv(station_code, gas_type, frequency, elevation_m, limit=10000):\n",
" # Use the ?f=csv and limit query to get more rows\n",
" url = f\"https://dev.ghg.center/api/features/collections/public.nist_testbed_nec_{station_code}_{gas_type}_{frequency}_concentrations/items?f=csv&elevation_m={elevation_m}&limit={limit}\"\n",
" \n",
" url = f\"https://earth.gov/ghgcenter/api/features/collections/public.nist_testbed_nec_{station_code}_{gas_type}_{frequency}_concentrations/items?f=csv&elevation_m={elevation_m}&limit={limit}\"\n",
" print(url)\n",
" try:\n",
" response = requests.get(url)\n",
" print(response)\n",
Expand Down Expand Up @@ -138,14 +138,16 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"https://earth.gov/ghgcenter/api/features/collections/public.nist_testbed_nec_uny_ch4_hourly_concentrations/items?f=csv&elevation_m=483&limit=10000\n",
"<Response [200]>\n",
"https://earth.gov/ghgcenter/api/features/collections/public.nist_testbed_nec_tmd_ch4_hourly_concentrations/items?f=csv&elevation_m=561&limit=10000\n",
"<Response [200]>\n"
]
},
Expand Down

0 comments on commit aec45ed

Please sign in to comment.