A command-line interface for interacting with the Manifold Markets API.
- Python 3.6 or higher
- A Manifold Markets API key (go to your profile settings - account settings)
-
Clone this repository:
-
Set your API key as an environment variable:
export MANIFOLD_API_KEY="your_api_key"
You can optionally install the requests library if you don't have it already:
pip install requests
Usage:
python3 cli-manifold.py <command> [options]
Available Commands:
search-market
Searches for markets by term.
Options:
--limit : Maximum number of markets to return (default: 10).
get-market
Retrieves market information by its slug.
get-user
Retrieves user information by username.
bet <contract_id>
Places a bet on a market.
Options:
--outcome <YES/NO>: Outcome to bet on (default: "YES").
--limit_prob : Limit probability for a limit order (optional).
--expires_at : Expiration timestamp for a limit order (optional).
sell <market_id> <YES/NO>
Sells shares of a market.
Options:
--shares : Number of shares to sell (optional, defaults to selling all shares).
--answer_id <answer_id>: Answer ID (required for multiple choice markets).
cancel-order <bet_id>
Cancels an existing limit order.
get-bets
Retrieves a list of the authenticated user's bets.
Options:
--limit : Maximum number of bets to return (default: 1000).
get-positions <market_id>
Retrieves positions information for a market.
Options:
--order <profit/shares>: Order results by profit or shares (default: "profit").
--top : Get the top N positions.
--bottom : Get the bottom N positions.
Examples:
Search for markets related to "AI":
python3 cli-manifold.py search-market AI --limit 20
Get information about a market with the slug "will-tesla-stock-go-up":
python3 cli-manifold.py get-market will-tesla-stock-go-up
Place a 5 manna bet on YES for the market with ID "abc123def456":
python3 cli-manifold.py bet abc123def456 5.00
Sell all YES shares for the market with ID "xyz789ghi012":
python3 cli-manifold.py sell xyz789ghi012 YES
This project is licensed under the MIT License - see the LICENSE file for details.