Skip to main content

TradeKart API

TradeKart API is a Python wrapper around the official Groww SDK with a service-oriented design for trading workflows.

It provides custom service layers for common operations (Orders, Portfolio) with request models, response models, and consistent exception handling so teams can build reliable trading integrations faster.

Why TradeKart API

  • Built on top of growwapi, so you can continue to use Groww's official SDK.
  • Clean service abstraction for business use-cases instead of raw SDK calls everywhere.
  • Typed request models for safer payload construction.
  • Structured response handling for predictable downstream processing.
  • Custom exceptions for easier debugging and application-level error handling.

Installation

pip install tradekartapi

Quick Start (Jupyter / Notebook)

from tradekartapi.client import TradeKartClient
from growwapi import GrowwAPI

access_token = "your_access_token"
client = TradeKartClient.from_access_token(access_token, GrowwAPI)
# Now client is ready to use the service

Service Architecture

TradeKart API uses:

  1. Groww SDK Adapter to initialize and hold the SDK client.
  2. Custom Services to expose trading operations as business-level methods.
  3. Models to keep request and response shapes explicit and reusable.

Available Services

  • Order Service
    • Place order
    • Modify order
    • Cancel order
    • Get order status
    • Get order list
    • Get order detail
  • Portfolio Service
    • Get holdings
    • Get positions
    • Get positions by trading symbol

Margin Service

Margin-related service support is planned as part of upcoming releases.

Orders Example

from tradekartapi.models.orders import PlaceOrderRequest
from tradekartapi.models.annexures import (
    Exchange, Segment, Product, OrderType, TransactionType, Validity
)

request = PlaceOrderRequest(
    trading_symbol="SBIN",
    quantity=1,
    validity=Validity.DAY,
    exchange=Exchange.NSE,
    segment=Segment.CASH,
    product=Product.CNC,
    order_type=OrderType.MARKET,
    transaction_type=TransactionType.BUY,
)

response = client.order_service.place_order(request)
print(response)

Portfolio Example

holdings = client.portfolio_service.get_holdings()
positions = client.portfolio_service.get_positions()

print([h.to_dict() for h in holdings])
print([p.to_dict() for p in positions])

Response Formats

Depending on the service method, you may receive:

  • Native dict from direct SDK passthrough methods.
  • Dataclass-based response objects from modeled service methods.

For dataclass responses, use:

  • to_dict() for Python dictionary output.
  • to_json() for JSON string output.

Error Handling

TradeKart API raises structured custom exceptions for validation and service-level failures, making it easier to map failures to API responses or logs in production systems.

Compatibility

  • Python >=3.10
  • Depends on growwapi

Changelog

Full changelog: https://tradekartapi.readthedocs.io/en/latest/changelog.html

License

MIT

Download files

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

Source Distribution

tradekartapi-0.2.4.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

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

tradekartapi-0.2.4-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

Details for the file tradekartapi-0.2.4.tar.gz.

File metadata

  • Download URL: tradekartapi-0.2.4.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for tradekartapi-0.2.4.tar.gz
Algorithm Hash digest
SHA256 0131a003568c32efc840dbbf7756cf11a62f52383bd3330ceedb2e333b149584
MD5 a8af4089fddffb091e6efdb52fb5e949
BLAKE2b-256 1e5cf0d921388962da0cd364379a74ddac42500458d6bb45921181a933c1697f

See more details on using hashes here.

File details

Details for the file tradekartapi-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: tradekartapi-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for tradekartapi-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8e3c2c07fde3d6458c3b78f39f1c2aa5163d35245aa35440fdf368ac7a8e2354
MD5 0d23daa2b5a0915adfaf7eeff5f44680
BLAKE2b-256 31f170ba77870633971e4868bfa5bc14c6ab7bf7b073ac14b09f616d7e7e68e6

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.5

2 files

This release

0.2.4 This release

2 files

0.2.1

2 files

0.2.0

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page