Skip to main content

Lightweight Python SDK for tvfin: hosted TradingView symbols, screeners, news, calendars, options, ideas, and scripts.

Project description

tvfin

Lightweight Python SDK for tvfin, a hosted TradingView data API for builders.

tvfin gives you access to TradingView market data without running your own browser or scraper stack: symbol search, news, economic calendars, earnings and dividend events, screeners, options data, public ideas, and public scripts through product-native namespaces. Use it for dashboards, agents, notebooks, research tools, watchlists, prototyping, and app backends.

This SDK is intentionally straightforward: plain dict responses, typed errors, automatic transient retries, and a public surface that follows tvfin routes rather than upstream provider endpoint names.

Docs: https://docs.tvfin.bluedoor.sh

pip install tvfin

Quick Use

from tvfin import Client

client = Client()

symbols = client.symbols.search("apple", exchange="NASDAQ")
news = client.news.for_symbol("NASDAQ:AAPL")
screen = client.screeners.search("america", columns="name,close", limit=5)
chain = client.options.chain("AAPL", limit=10)

print(symbols["data"], news["data"], screen["data"], chain["data"])

Common Calls

client.symbols.search("tesla", type="stock")
client.news.headlines(lang="en")
client.news.flow(market="stocks")
client.calendar.economic(country="US")
client.events.earnings(limit=25, columns="name,earnings_release_date")
client.screeners.metadata("america")
client.screeners.search("america", limit=25, columns="name,close,volume")
client.screeners.global_search(markets="america,crypto", limit=25)
client.options.implied_volatility("AAPL")
client.options.underlying_aggregates("AAPL")
client.ideas.list(symbol="AAPL")
client.scripts.list(symbol="AAPL")

The client is organized around tvfin product areas: symbols, news, calendar, events, screeners, options, ideas, scripts, and management.

Runtime Support

Configuration can come from constructor options or environment variables:

Option Environment Purpose
base_url TVFIN_BASE_URL Override https://api.tvfin.bluedoor.sh; must be http or https
contact TVFIN_CONTACT Send optional support metadata
api_key TVFIN_API_KEY Send email-verified API credentials
management_token TVFIN_MANAGEMENT_TOKEN Manage API keys after email verification

api_key is sent as Authorization: Bearer <key> by default. Pass api_key_header="x-tvfin-key" to use X-Tvfin-Key instead.

The SDK retries transient 429, 502, 503, and 504 responses by default. Use max_retries, retry_statuses, backoff_factor, max_backoff, and backoff_jitter when you need tighter control, or set max_retries=0.

Keep API keys on a server when you do not control the runtime.

Auth Helpers

client = Client()
client.management.request_auth_otp("you@example.com")
verified = client.management.verify_auth_otp("you@example.com", "123456", label="agent")

api_key = verified["data"]["api_key"]
management_token = verified["data"]["management_token"]

authed = Client(api_key=api_key)
authed.management.request_limit_increase(
    requested_rps=25,
    use_case="production agent workload",
    message="Short traffic description.",
)

managed = Client(management_token=management_token)
keys = managed.management.keys.list()
created = managed.management.keys.create(label="batch job")
managed.management.keys.rotate(created["data"]["key"]["id"])

All successful calls return the hosted tvfin envelope:

{
    "data": {},
    "meta": {
        "provider": "tradingview",
        "generated_at": "2026-01-01T00:00:00Z",
        "route": "symbols_search",
    },
}

Errors

HTTP errors raise TvfinError. HTTP 429 raises TvfinRateLimitError; HTTP 503 raises TvfinServiceBusyError after retry exhaustion. Error objects include retry_after, status, request_id, and the response message.

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

tvfin-0.2.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

tvfin-0.2.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file tvfin-0.2.1.tar.gz.

File metadata

  • Download URL: tvfin-0.2.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tvfin-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c6bb8ed66bc5aa6b6cb16dc2fbce02e46e5dd9674e3b62edc50afad32321ed9c
MD5 51e2e6f1f9148bb1f32cb056c8395f92
BLAKE2b-256 8457d9ea6f03cf5b286409c9f95ddeae44dc1785d1bb5f3fb05ef6b840d2ddda

See more details on using hashes here.

Provenance

The following attestation bundles were made for tvfin-0.2.1.tar.gz:

Publisher: publish-tvfin-python.yml on bluefin-ai/fin-services

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tvfin-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: tvfin-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tvfin-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0c368d341fc7e410ccd947f06fd863966f04e222a89e3e616c436e1fc3bd1db7
MD5 018fbbb55750bb441fb7558f14fbbcee
BLAKE2b-256 62ca2106e502a2ed7b7cb35b2b1d67e60d465fb8cdf4a48c3f869460f100bdc9

See more details on using hashes here.

Provenance

The following attestation bundles were made for tvfin-0.2.1-py3-none-any.whl:

Publisher: publish-tvfin-python.yml on bluefin-ai/fin-services

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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