You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Enter your open.data.gov API Key as a Livebook Secret named "API_DATA_GOV_KEY"# For reference on Livebook secrets - https://www.youtube.com/watch?v=laG04lxagZI{:ok,api_key}=System.fetch_env("LB_API_DATA_GOV_KEY")
%{body: body}=HTTPoison.get!(url)json=Jason.decode!(body)# Grab the "items" key from the API's json response%{"items"=>sites}=json
Show all websites
sites
Re-encode the data as .json and write it to file
json_data=sites|>Jason.encode!()File.write!("site-scanning-sites.json",json_data)# Alternatively, you could just write the original body of the response to file# File.write!("site-scanning-sites.json", body)