Skip to main content
Use the Terraform provider when you want declarative infrastructure for TwexAPI write actions such as follow, tweet, like, retweet, bookmark, and DM resources. Search, timelines, communities, and other reads stay on the REST API or language SDKs.
The Terraform Registry listing is not published yet. Build locally and use a dev_overrides block until the provider is published.

Install

Terraform CLI 1.0 or newer.
Local development override in ~/.terraformrc:
Then:
Source: twexapi-dev/terraform-provider-x-api-scraper

Authenticate

Prefer environment variables:
Or set bearer_auth on the provider. Write resources also need a Twitter cookie or auth_token. Never commit credentials or Terraform state.

Read a profile

Follow an account

Post a tweet

Changing tweet_content replaces the resource. Destroy deletes the tweet.

Like, retweet, or bookmark

Destroy reverses the action.

Send a DM

Destroy removes Terraform state only. The API cannot unsend a DM.

Search and pagination

For tweet search, follower exports, and other paginated reads, use the Go SDK, TypeScript SDK, or CLI instead of Terraform.

References