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.

System Design

TradeKart API System Design

TradeKart API System Design

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

Metadata

Release files for tradekartapi 0.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tradekartapi 0.2.8
File Size Uploaded Provenance Actions
tradekartapi-0.2.8.tar.gz 28.7 kB Without provenance Details for tradekartapi-0.2.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tradekartapi 0.2.8
File Interpreter ABI Platform Actions
tradekartapi-0.2.8-py3-none-any.whl Python 3 none any Details for tradekartapi-0.2.8-py3-none-any.whl

Total release size: 71.2 kB

Release files / tradekartapi-0.2.8.tar.gz

Download URL tradekartapi-0.2.8.tar.gz
Size 28.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5261b48a0a313c63ba1306c483fb908c49a90cd86172e8aa7649435a9ab8c2ea
BLAKE2b-256 checksum
How to use checksums
7c791a4b7b7c92e61a61c2189bf6cf46aeb4632bacd01a3855e2042384e9213a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / tradekartapi-0.2.8-py3-none-any.whl

Download URL tradekartapi-0.2.8-py3-none-any.whl
Size 42.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34bc94c208ac470e6d063f8abf3e56acfe0ceb5aa198590e0845694632edc6fd
BLAKE2b-256 checksum
How to use checksums
ae0164495191cefea689c0f32d4e6293ff9123f6b9ca78ce14fc1e5f276c16e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Security for tradekartapi 0.2.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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