Skip to main content

Twitter Plugin for Python SDK for GAME by Virtuals

Project description

Twitter Plugin for GAME SDK

The Twitter Plugin provides a lightweight interface for integrating Twitter (X) functionality into your GAME SDK agents. Built on top of virtuals_tweepy by the Virtuals team — a maintained fork of Tweepy) — this plugin lets you easily post tweets, fetch data, and execute workflows through agent logic.

📜 GAME X API Usage Terms & Rules

By using our GAME API, you agree to the Terms of Use and GAME X API Terms.

🚀 API Access Tiers

Virtuals sponsors the community with a Twitter Enterprise API access plan, using OAuth 2.0 with PKCE. This provides:

🚀 API Access Tiers

Tier 1 — Default

  • Higher rate limits: 50 calls / 5 minutes
  • Smoother onboarding
  • Free usage via your GAME_API_KEY

Tier 2 — Elevated

  • Even higher rate limits
  • Requires approval from the Virtuals team. Request access via Discord → @virtualsio

Use it standalone or compose multiple Twitter actions as part of a larger agent job.

Installation

You can install the plugin using either poetry or pip:

# Using Poetry (from the plugin directory)
poetry install

or

# Using pip (recommended for integration projects)
pip install twitter_plugin_gamesdk

Authentication Methods

Virtuals sponsors the community with a Twitter Enterprise API access plan, using OAuth 2.0 with PKCE. This provides:

  • Higher rate limits: 35 calls / 5 minutes
  • Smoother onboarding
  • Free usage via your GAME_API_KEY

1. Get Your Access Token

Run the following command to authenticate using your GAME_API_KEY:

poetry run twitter-plugin-gamesdk auth -k <GAME_API_KEY>

This will prompt:

Waiting for authentication...

Visit the following URL to authenticate:
https://x.com/i/oauth2/authorize?...

Authenticated! Here's your access token:
apx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

2. Store Your Access Token

We recommend storing environment variables in a .env file:

# .env

GAME_TWITTER_ACCESS_TOKEN=apx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Then, use load_dotenv() to load them:

import os
from dotenv import load_dotenv
from twitter_plugin_gamesdk.twitter_plugin import TwitterPlugin

load_dotenv()

options = {
    "credentials": {
        "game_twitter_access_token": os.environ.get("GAME_TWITTER_ACCESS_TOKEN")
    }
}

twitter_plugin = TwitterPlugin(options)
client = twitter_plugin.twitter_client

client.create_tweet(text="Tweeting with GAME Access Token!")

Examples

Explore the examples/ directory for sample scripts demonstrating how to:

  • Post tweets
  • Reply to mentions
  • Quote tweets
  • Fetch user timelines
  • And more!

API Reference

This plugin wraps virtuals_tweepy, which is API-compatible with Tweepy’s client interface. Refer to their docs for supported methods and parameters.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twitter_plugin_gamesdk-0.2.11.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twitter_plugin_gamesdk-0.2.11-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file twitter_plugin_gamesdk-0.2.11.tar.gz.

File metadata

  • Download URL: twitter_plugin_gamesdk-0.2.11.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.5 Darwin/24.3.0

File hashes

Hashes for twitter_plugin_gamesdk-0.2.11.tar.gz
Algorithm Hash digest
SHA256 32539ee3260f58d77d63c245241b24d82ddceec1c2f05a3056a93b96b7bdd03c
MD5 9a587efd634e9f38fe0337d36404c631
BLAKE2b-256 90a1530363b788560fd532fc10d899b55aabe37d3e73073718cf506eac66a2fd

See more details on using hashes here.

File details

Details for the file twitter_plugin_gamesdk-0.2.11-py3-none-any.whl.

File metadata

File hashes

Hashes for twitter_plugin_gamesdk-0.2.11-py3-none-any.whl
Algorithm Hash digest
SHA256 c41c448d9d56e34b67204fa958acf771c417f4da49b0916b57a7e5fbd41ede52
MD5 6cc30cd1134d90259449a8ddbd49cda9
BLAKE2b-256 e1341803e0b0480bbac062647d697da4ab728a33b06544cb58c48e50e9ef45b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page