← all adapters

twitter-style

simulates Twitter/X API v2

restadapter v0.1.09 routes

verification

VMVM tier — no SDK suite yet· surface 9 · not implemented 6 · differs 5

use it

# add to stunt.yaml
services:
  twitter:
    adapter: embedded:twitter-style

# then
$ stunt up

The embedded: source extracts this adapter from the binary — no git clone, fully offline.

how to mock the Twitter/X API locally

Install stunt, paste the service block above into stunt.yaml, run stunt up — then point your client at localhost instead of Twitter/X API. It works offline, keeps state across requests and restarts, and every response is synthetic: the route shapes, status codes, pagination, and webhook delivery follow the real Twitter/X API v2 surface — the data is fake, the behavior is real.

backing stores

tweetsusers

api surface (9)

generated from the adapter manifest — exactly what boots, nothing more · covers 4% of the real API's 178 routes (derived from spec X API v2 openapi (published at the API origin) @ 2.167)

9 routes
POST/2/oauth2/token
GET/2/users/me
GET/2/users/by/username/{username}
GET/2/users/{id}
POST/2/tweets
GET/2/tweets/{id}
GET/2/tweets
DELETE/2/tweets/{id}
GET/2/users/{id}/timelines/reverse_chronological

VM-verified behaviors (12)

  • the mock oauth2 endpoint mints a bearer and the bearer gate is never enforced
  • create enforces the 280-char limit and reply-chain integrity with v2 400 envelopes
  • create answers 201 {data:{id,text}} with kv-sequence ids and clock-stamped created_at
  • read by id projects tweet.fields and expands author_id into includes
  • delete answers {data:{deleted:true}} and later reads are 404s
  • /me resolves the literal route before /2/users/{id} and returns v2's default field set
  • show by id and lookup by username round-trip the seeded users
  • unknown users are resource-not-found 404s in the v2 envelope
  • the timeline is newest-first and loses nothing by default
  • start_time/end_time bound created_at and exclude=replies drops threads
  • max_results pages via meta.next_token; an invalid pagination_token is a 400
  • the tweet list shares the same v2 paging and stays unpaged without max_results

Not implemented (6)

  • No tweet search (/2/tweets/search/recent or /all) endpoints
  • No likes, reposts, bookmarks, or quote/reply tweet operations
  • No follows, blocks, mutes, or follower-list endpoints
  • No media upload, polls, or long-form (note) tweet support
  • No spaces, lists, DMs, or compliance surfaces
  • No filtered or sample stream endpoints

Differs from the real API (5)

  • Auth is mock and not enforced; any or no Authorization header is accepted everywhere
  • POST /2/oauth2/token always succeeds, minting a fake token (no PKCE or client creds)
  • GET /2/tweets list-all is a simulator extension; the real API has no such list endpoint
  • Bare GET /2/tweets/{id} returns the full stored doc, not v2's id+text default
  • since_id/until_id are not honored on the timeline
want more of the Twitter/X API surface? adapters are YAML + Starlark — the authoring guide covers adding routes, fixtures, and state machines. Open an issue for anything big first, or just file a PR — merged routes ship in the next release.