Skip to contents

Sends a GET request to https://api.covid19tracker.ca/. If the request is successful and the returned content is JSON, formats it and returns it parsed (via jsonlite::fromJSON).

Usage

get_content_parsed(url)

Arguments

url

A string URL linking to the API. If it does not contain the base "https://api.covid19tracker.ca", then url will be combined with the base to attempt to make a valid URL (and return a warning).

Value

A list.

Examples


get_content_parsed("https://api.covid19tracker.ca/provinces")
#> [[1]]
#> [[1]]$id
#> [1] 1
#> 
#> [[1]]$code
#> [1] "ON"
#> 
#> [[1]]$name
#> [1] "Ontario"
#> 
#> [[1]]$data_source
#> NULL
#> 
#> [[1]]$population
#> [1] 14826276
#> 
#> [[1]]$area
#> [1] 917741
#> 
#> [[1]]$gdp
#> [1] 857384
#> 
#> [[1]]$geographic
#> [1] 1
#> 
#> [[1]]$data_status
#> [1] "Reported"
#> 
#> [[1]]$created_at
#> NULL
#> 
#> [[1]]$updated_at
#> [1] "2022-08-22T02:10:20.000000Z"
#> 
#> [[1]]$density
#> [1] 16.15519
#> 
#> 
#> [[2]]
#> [[2]]$id
#> [1] 2
#> 
#> [[2]]$code
#> [1] "QC"
#> 
#> [[2]]$name
#> [1] "Quebec"
#> 
#> [[2]]$data_source
#> NULL
#> 
#> [[2]]$population
#> [1] 8604495
#> 
#> [[2]]$area
#> [1] 1356128
#> 
#> [[2]]$gdp
#> [1] 439375
#> 
#> [[2]]$geographic
#> [1] 1
#> 
#> [[2]]$data_status
#> [1] "Reported"
#> 
#> [[2]]$created_at
#> NULL
#> 
#> [[2]]$updated_at
#> [1] "2022-08-22T10:22:17.000000Z"
#> 
#> [[2]]$density
#> [1] 6.344899
#> 
#> 
#> [[3]]
#> [[3]]$id
#> [1] 3
#> 
#> [[3]]$code
#> [1] "NS"
#> 
#> [[3]]$name
#> [1] "Nova Scotia"
#> 
#> [[3]]$data_source
#> NULL
#> 
#> [[3]]$population
#> [1] 992055
#> 
#> [[3]]$area
#> [1] 53338
#> 
#> [[3]]$gdp
#> [1] 44354
#> 
#> [[3]]$geographic
#> [1] 1
#> 
#> [[3]]$data_status
#> [1] "No report expected today"
#> 
#> [[3]]$created_at
#> NULL
#> 
#> [[3]]$updated_at
#> [1] "2022-08-15T22:52:42.000000Z"
#> 
#> [[3]]$density
#> [1] 18.5994
#> 
#> 
#> [[4]]
#> [[4]]$id
#> [1] 4
#> 
#> [[4]]$code
#> [1] "NB"
#> 
#> [[4]]$name
#> [1] "New Brunswick"
#> 
#> [[4]]$data_source
#> NULL
#> 
#> [[4]]$population
#> [1] 789225
#> 
#> [[4]]$area
#> [1] 71450
#> 
#> [[4]]$gdp
#> [1] 36966
#> 
#> [[4]]$geographic
#> [1] 1
#> 
#> [[4]]$data_status
#> [1] "Reported"
#> 
#> [[4]]$created_at
#> NULL
#> 
#> [[4]]$updated_at
#> [1] "2022-08-15T22:50:10.000000Z"
#> 
#> [[4]]$density
#> [1] 11.04584
#> 
#> 
#> [[5]]
#> [[5]]$id
#> [1] 5
#> 
#> [[5]]$code
#> [1] "MB"
#> 
#> [[5]]$name
#> [1] "Manitoba"
#> 
#> [[5]]$data_source
#> NULL
#> 
#> [[5]]$population
#> [1] 1383765
#> 
#> [[5]]$area
#> [1] 553556
#> 
#> [[5]]$gdp
#> [1] 72688
#> 
#> [[5]]$geographic
#> [1] 1
#> 
#> [[5]]$data_status
#> [1] "No report expected today"
#> 
#> [[5]]$created_at
#> NULL
#> 
#> [[5]]$updated_at
#> [1] "2022-08-15T23:01:29.000000Z"
#> 
#> [[5]]$density
#> [1] 2.499774
#> 
#> 
#> [[6]]
#> [[6]]$id
#> [1] 6
#> 
#> [[6]]$code
#> [1] "BC"
#> 
#> [[6]]$name
#> [1] "British Columbia"
#> 
#> [[6]]$data_source
#> NULL
#> 
#> [[6]]$population
#> [1] 5214805
#> 
#> [[6]]$area
#> [1] 925186
#> 
#> [[6]]$gdp
#> [1] 295401
#> 
#> [[6]]$geographic
#> [1] 1
#> 
#> [[6]]$data_status
#> [1] "Reported"
#> 
#> [[6]]$created_at
#> NULL
#> 
#> [[6]]$updated_at
#> [1] "2022-08-22T02:26:05.000000Z"
#> 
#> [[6]]$density
#> [1] 5.636494
#> 
#> 
#> [[7]]
#> [[7]]$id
#> [1] 7
#> 
#> [[7]]$code
#> [1] "PE"
#> 
#> [[7]]$name
#> [1] "Prince Edward Island"
#> 
#> [[7]]$data_source
#> NULL
#> 
#> [[7]]$population
#> [1] 164318
#> 
#> [[7]]$area
#> [1] 5660
#> 
#> [[7]]$gdp
#> [1] 6994
#> 
#> [[7]]$geographic
#> [1] 1
#> 
#> [[7]]$data_status
#> [1] "Reported"
#> 
#> [[7]]$created_at
#> NULL
#> 
#> [[7]]$updated_at
#> [1] "2022-08-15T22:50:27.000000Z"
#> 
#> [[7]]$density
#> [1] 29.03145
#> 
#> 
#> [[8]]
#> [[8]]$id
#> [1] 8
#> 
#> [[8]]$code
#> [1] "SK"
#> 
#> [[8]]$name
#> [1] "Saskatchewan"
#> 
#> [[8]]$data_source
#> NULL
#> 
#> [[8]]$population
#> [1] 1179844
#> 
#> [[8]]$area
#> [1] 591670
#> 
#> [[8]]$gdp
#> [1] 80679
#> 
#> [[8]]$geographic
#> [1] 1
#> 
#> [[8]]$data_status
#> [1] "No report expected today"
#> 
#> [[8]]$created_at
#> NULL
#> 
#> [[8]]$updated_at
#> [1] "2022-08-22T02:30:30.000000Z"
#> 
#> [[8]]$density
#> [1] 1.994091
#> 
#> 
#> [[9]]
#> [[9]]$id
#> [1] 9
#> 
#> [[9]]$code
#> [1] "AB"
#> 
#> [[9]]$name
#> [1] "Alberta"
#> 
#> [[9]]$data_source
#> NULL
#> 
#> [[9]]$population
#> [1] 4442879
#> 
#> [[9]]$area
#> [1] 642317
#> 
#> [[9]]$gdp
#> [1] 344812
#> 
#> [[9]]$geographic
#> [1] 1
#> 
#> [[9]]$data_status
#> [1] "Reported"
#> 
#> [[9]]$created_at
#> NULL
#> 
#> [[9]]$updated_at
#> [1] "2022-08-22T02:15:30.000000Z"
#> 
#> [[9]]$density
#> [1] 6.916957
#> 
#> 
#> [[10]]
#> [[10]]$id
#> [1] 10
#> 
#> [[10]]$code
#> [1] "NL"
#> 
#> [[10]]$name
#> [1] "Newfoundland and Labrador"
#> 
#> [[10]]$data_source
#> NULL
#> 
#> [[10]]$population
#> [1] 520553
#> 
#> [[10]]$area
#> [1] 373872
#> 
#> [[10]]$gdp
#> [1] 33241
#> 
#> [[10]]$geographic
#> [1] 1
#> 
#> [[10]]$data_status
#> [1] "No report expected today"
#> 
#> [[10]]$created_at
#> NULL
#> 
#> [[10]]$updated_at
#> [1] "2022-08-15T22:50:18.000000Z"
#> 
#> [[10]]$density
#> [1] 1.392329
#> 
#> 
#> [[11]]
#> [[11]]$id
#> [1] 11
#> 
#> [[11]]$code
#> [1] "NT"
#> 
#> [[11]]$name
#> [1] "Northwest Territories"
#> 
#> [[11]]$data_source
#> NULL
#> 
#> [[11]]$population
#> [1] 45504
#> 
#> [[11]]$area
#> [1] 1183085
#> 
#> [[11]]$gdp
#> [1] 4730
#> 
#> [[11]]$geographic
#> [1] 1
#> 
#> [[11]]$data_status
#> [1] "No report expected today"
#> 
#> [[11]]$created_at
#> NULL
#> 
#> [[11]]$updated_at
#> [1] "2022-08-15T22:50:34.000000Z"
#> 
#> [[11]]$density
#> [1] 0.03846216
#> 
#> 
#> [[12]]
#> [[12]]$id
#> [1] 12
#> 
#> [[12]]$code
#> [1] "YT"
#> 
#> [[12]]$name
#> [1] "Yukon"
#> 
#> [[12]]$data_source
#> NULL
#> 
#> [[12]]$population
#> [1] 42986
#> 
#> [[12]]$area
#> [1] 474391
#> 
#> [[12]]$gdp
#> [1] 3046
#> 
#> [[12]]$geographic
#> [1] 1
#> 
#> [[12]]$data_status
#> [1] "Reported"
#> 
#> [[12]]$created_at
#> NULL
#> 
#> [[12]]$updated_at
#> [1] "2022-08-15T22:51:21.000000Z"
#> 
#> [[12]]$density
#> [1] 0.09061302
#> 
#> 
#> [[13]]
#> [[13]]$id
#> [1] 13
#> 
#> [[13]]$code
#> [1] "NU"
#> 
#> [[13]]$name
#> [1] "Nunavut"
#> 
#> [[13]]$data_source
#> NULL
#> 
#> [[13]]$population
#> [1] 39403
#> 
#> [[13]]$area
#> [1] 1936113
#> 
#> [[13]]$gdp
#> [1] 3421
#> 
#> [[13]]$geographic
#> [1] 1
#> 
#> [[13]]$data_status
#> [1] "No report expected today"
#> 
#> [[13]]$created_at
#> NULL
#> 
#> [[13]]$updated_at
#> [1] "2022-08-15T22:51:02.000000Z"
#> 
#> [[13]]$density
#> [1] 0.0203516
#> 
#> 
#> [[14]]
#> [[14]]$id
#> [1] 14
#> 
#> [[14]]$code
#> [1] "_RC"
#> 
#> [[14]]$name
#> [1] "Repatriated Canadians"
#> 
#> [[14]]$data_source
#> NULL
#> 
#> [[14]]$population
#> NULL
#> 
#> [[14]]$area
#> NULL
#> 
#> [[14]]$gdp
#> NULL
#> 
#> [[14]]$geographic
#> [1] 0
#> 
#> [[14]]$data_status
#> [1] ""
#> 
#> [[14]]$created_at
#> NULL
#> 
#> [[14]]$updated_at
#> NULL
#> 
#> [[14]]$density
#> NULL
#> 
#> 
#> [[15]]
#> [[15]]$id
#> [1] 15
#> 
#> [[15]]$code
#> [1] "FA"
#> 
#> [[15]]$name
#> [1] "Federal Allocation"
#> 
#> [[15]]$data_source
#> NULL
#> 
#> [[15]]$population
#> NULL
#> 
#> [[15]]$area
#> NULL
#> 
#> [[15]]$gdp
#> NULL
#> 
#> [[15]]$geographic
#> [1] 0
#> 
#> [[15]]$data_status
#> [1] ""
#> 
#> [[15]]$created_at
#> NULL
#> 
#> [[15]]$updated_at
#> [1] "2022-03-10T20:41:40.000000Z"
#> 
#> [[15]]$density
#> NULL
#> 
#> 
#> [[16]]
#> [[16]]$id
#> [1] 16
#> 
#> [[16]]$code
#> [1] "NFR"
#> 
#> [[16]]$name
#> [1] "National Federal Reserve"
#> 
#> [[16]]$data_source
#> NULL
#> 
#> [[16]]$population
#> NULL
#> 
#> [[16]]$area
#> NULL
#> 
#> [[16]]$gdp
#> NULL
#> 
#> [[16]]$geographic
#> [1] 0
#> 
#> [[16]]$data_status
#> [1] ""
#> 
#> [[16]]$created_at
#> NULL
#> 
#> [[16]]$updated_at
#> [1] "2022-08-15T22:51:36.000000Z"
#> 
#> [[16]]$density
#> NULL
#> 
#>