Query editor
WITH resp AS (SELECT CAST(json_parse(http_get('https://d7jmnyp9fu.us-west-2.awsapprunner.com/privy/stats/daily/history?limit=100')) AS array(json)) AS arr),rows AS (SELECTfrom_iso8601_timestamp(json_extract_scalar(x, '$.date')) AS day_ts,TRY_CAST(json_extract_scalar(x, '$.total_users') AS bigint) AS total_users,TRY_CAST(json_extract_scalar(x, '$.new_users_today') AS bigint) AS new_users_today,from_iso8601_timestamp(json_extract_scalar(x, '$.recorded_at')) AS recorded_atFROM respCROSS JOIN UNNEST(arr) AS t(x)),daily AS (SELECTDATE(day_ts) AS day,max_by(total_users, recorded_at) AS total_users,max_by(new_users_today, recorded_at) AS new_users_todayFROM rowsGROUP BY 1)SELECTday,new_users_today,total_usersFROM dailyORDER BY day;