Skip to main content

An unofficial python client for the Kalshi API

Project description

kalshi-client

An unofficial python client for the Kalshi API.

This package fixes some of the outdated code that was provided by Kalshi in their API documentation. This project aims to facilitate usage of the API through documentation and readability.

Changes

  • Removed old endpoints and added new ones
  • Added parameters that weren't in original code
  • Added documentation and made code readable
  • Use requests session for static parts of headers

Installation

pip install kalshi-client

Usage

Below is an example of how to use kalshi-client to print your balance on Kalshi

from kalshi_client.client import ExchangeClient
from kalshi_client.utils import load_private_key_from_file

if __name__ == "__main__":

    # You can get your api keys from https://kalshi.com/account/profile
    # It will ask you to save the RSA private key as text file
    # The key id is the one that is visible that you can copy paste

    key_id = "your key id"
    exchange_client = ExchangeClient(key_id=key_id, private_key=load_private_key_from_file("private_key.txt"))

    print(exchange_client.get_balance())

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes.

Credits

License

This project is licensed under the MIT License.

Disclaimer

By using this client, you agree to Kalshi's Developer Agreement.

Note: This client is an unofficial implementation and is not affiliated with Kalshi.

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

kalshi-client-0.1.5.tar.gz (10.2 kB view details)

Uploaded Source

File details

Details for the file kalshi-client-0.1.5.tar.gz.

File metadata

  • Download URL: kalshi-client-0.1.5.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for kalshi-client-0.1.5.tar.gz
Algorithm Hash digest
SHA256 e706f7fec8657310ed43129d8da1000db6df98acb65b1e67ef60d976993395d6
MD5 59111f55dec42a2725c9ac55adeb0d4f
BLAKE2b-256 d3fc2a5ba4cb0221e938efe0f8e9918ccb70fdd1022918b4e71415fa3b30a051

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