Skip to main content

Python sdk for Axis Direct trading API based on the documentation provided by the Axis Direct. https://documenter.getpostman.com/view/33771924/2sA3BkasEf

Project description

The Axis Direct Rapid API Python client

Python library for Axis Direct trading API based on the documentation provided by the Axis Direct (RAPID API by Axis Direct). Axis Direct API.

RAPID API by Axis Direct is a powerful tool that expose many capabilities required to build a personalized Trading and Investment platform. Place orders, fetch user holdings, positions, orders, and more, with the simple HTTP API collection. This is not official library from the Axis Direct.

Documentation

Installing the client

You can install the latest release via pip

pip install --upgrade rapidapi-axisdirect

Requirements

'client_id' and 'authorization_key' are required to use this client. Read the official documentation for more information here

API usage

from rapidapi_axisdirect import AxisAPIClient

axis_client = AxisAPIClient(client_id="your_api_key-xxx-xxx-x", authorization_key="your_authorization_keyxx-xxx-x")

# Initialize the initiate_sso method with $redirectURL to get the SSO login url.

login_url = axis_client.initiate_sso('https://app.example.com/redirect-here')

# Redirect the user to the login url obtained ('login_url')
# User will be redirected to the given $redirectURL with 'ssoId' after the SSO login flow.
# Once you have the ssoId, obtain the authToken and subAccountId

data = axis_client.authenticate_sso('ssoId')

axis_client.set_session(data['metadata']['accounts'][0]['subAccountId'], data['authToken']['token'])

# Place an order
try:
    order_resp = axis_client.place_order(order_ref_id="any_unique_remark",
                                script_id="11500112",
                                exchange='BSE',
                                transaction_type="BUY",
                                quantity=1,
                                segment='EQ,
                                order_type="MARKET",
                                product_type='DELIVERY',
                                validity_type='DAY')

    print("Order placed- response: ", order_resp)
except Exception as e:
    print("Failed. response: ", e.message)

# Fetch all orders by status
axis_client.get_order_book(order_status='open')

# Fetch the order history of a particular order.
axis_client.get_order_history("2024712987987")

# Get Security master
axis_client.get_security_master()

# Get the status of the market.
axis_client.get_market_status()

# Get holdings
axis_client.holdings(segment="EQ")

Changelog

Check release notes

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

rapidapi_axisdirect-0.0.2.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

rapidapi_axisdirect-0.0.2-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file rapidapi_axisdirect-0.0.2.tar.gz.

File metadata

  • Download URL: rapidapi_axisdirect-0.0.2.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for rapidapi_axisdirect-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9be761f85591809acbb9c0112998480b952cb5d97ec636660f7021ad248c12fe
MD5 6ef0a21188c80e6ed3c9e3ec17e6aac2
BLAKE2b-256 108ea257b0989fcb2226dae02bcde64029e454a3c5079bd5a9c715c0e6ca6215

See more details on using hashes here.

File details

Details for the file rapidapi_axisdirect-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for rapidapi_axisdirect-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dc96d967665effad907eb132c0f17ccf01b56db88bb884993d7e7193c296688d
MD5 41e6d43bc11aa075c5db0f3dfa158299
BLAKE2b-256 fac72f48a7c1d696e8c36f1dfa6438c222d5acea28b83d4e351171b61c8b79e3

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