docs(social): the scrape contract — per-platform posts, what one scrape stores, post engagement, follower history (app#2018)
Contract PR for recoupable/app#2018 (scrape persistence keystone). Absorbs the docs rows of app#2017 (posts per platform) and app#2026 (history on /socials).
What changes
POST /api/socials/{id}/scrape (social.json)
- Credits formula (
5 + posts), a per-platform table forposts(honored / actor parameter / default when omitted), a "What gets stored" list (profile, daily follower snapshot, posts with engagement, Instagram comments + commenter enrichment) and the one-hop rule for fan discovery. - Corrects the old text:
startInstagramProfileScrapingnever forwardsposts, so Instagram ignores it and always returns the profile's latest posts (up to 12); TikTok honors it (resultsPerPage). The previous "other platforms ignore this parameter" was wrong for TikTok and silent about Instagram. postsparameter description shortened to point at the table.
GET /api/artists/{id}/posts (social.json)
ArtistPostgains nullableviews,likes,comments,reposts, each with the per-platform source field (e.g. TikTokplayCount, XviewCount); description states they are the values at the last scrape and null where the platform does not report them.
GET /api/artists/{id}/socials (releases.json)
- New
history=<days>query (1–90) returninghistory: SocialSnapshot[]per profile, newest first, one point per social per day (latest scrape that day wins). NewSocialSnapshotschema (captured_at,follower_count,following_count,post_count). - Documents
page/limit(the validator already accepts them) and the real401/403/404the route returns; previously only400was listed.
POST /api/artist/socials/scrape (releases.json) — posts description aligned with the single-social page, credits per profile stated.
GET /api/artists/{id}/fans (releases.json) — states that fans are commenters on scraped posts (Instagram today) and that the commenter profile run fills avatar/bio/follower counts. (The per-platform coverage table stays with app#2024.)
Merge order
docs (this) → database (social_snapshots, posts engagement columns, apify_scraper_runs lineage) → api keystone → api budget. This PR is the contract the api PR is tested against.
Edits were applied as anchored text replacements (the files do not round-trip byte-identically through json.dumps); both files re-parse.
🤖 Generated with Claude Code
https://claude.ai/code/session_012PS8hmiwR1rGD6c41n6gD8
Summary by cubic
Defines the scrape persistence contract in the OpenAPI specs for recoupable/app#2018: per-platform post depth, what one scrape stores, post engagement fields, and follower history.
What changed
POST /api/socials/{id}/scrapenow documents the credits formula (5 + posts) and a per-platform table; Instagram ignorespostsand always returns the latest 12 posts, while TikTok honors it — correcting previously wrong text.ArtistPostgains nullableviews,likes,comments, andreposts, each with the per-platform source field.GET /api/artists/{id}/socialsaddshistory=<days>(1–90) returningSocialSnapshot[]per profile and documents the real401/403/404responses;following_countandpost_countare null where the platform does not report them.GET /api/artists/{id}/fansnow states fans are commenters on scraped posts (Instagram today) and that the enrichment pass fills avatar, bio, and follower and following counts.- The batch scrape
postsdescription is aligned with the single-social endpoint.