select
snapshot_date, week_number, listeners, playcount,
listener_delta, listener_pct_change, listeners_indexed
from api_artist_timeseries
where artist_id = $1
order by snapshot_date ascIndexed to 100 at each series' first observation.
with peers as (
select similar_artist_id as artist_id
from api_artist_similar
where artist_id = $1
),
peer_agg as (
select
ts.snapshot_date,
count(*) as artist_count,
percentile_cont(0.25) within group (order by ts.listeners_indexed) as p25_indexed,
percentile_cont(0.5) within group (order by ts.listeners_indexed) as median_indexed,
percentile_cont(0.75) within group (order by ts.listeners_indexed) as p75_indexed
from api_artist_timeseries ts
join peers p on p.artist_id = ts.artist_id
group by ts.snapshot_date
)
select ts.*, pa.artist_count, pa.p25_indexed, pa.median_indexed, pa.p75_indexed
from api_artist_timeseries ts
left join peer_agg pa on pa.snapshot_date = ts.snapshot_date
where ts.artist_id = $1
order by ts.snapshot_date asc| Artist | Listeners | 13-week growth |
|---|---|---|
| Boz Scaggs | 602k | +1.76% |
| Seals And Crofts | 530k | +5.76% |
| Dr. Hook | 497k | +2.16% |
| Little River Band | 607k | +2.88% |
| Ambrosia | 474k | +6.86% |
| Michael McDonald | 469k | +2.99% |
| Leo Sayer | 570k | +3.17% |
select
similar_artist_id, slug, display_name, size_band,
latest_listeners, total_pct_growth, weeks_tracked, similarity_score, rank
from api_artist_similar
where artist_id = $1
order by rank ascselect *
from api_artist_profile
where artist_id = $1