Building an AI agent? Start with /llms.txt for the full site index.
Workflows / Use Cases
Building a verifiable Taiwan fundamentals workflow from monthly revenue, the income statement, the balance sheet and valuation data.
Developers, researchers and agent integrators building a Taiwan fundamentals workflow on the API.
If what you want is a research process that reruns and can be checked, start here.
Fundamentals work usually draws on monthly revenue, the income statement, the balance sheet, the cash flow statement and valuation data. Use one consistent rule for tickers, dates and sourcing across all of them — cross-dataset misalignment is the most common way this goes wrong.
Before starting:
Every request carries X-API-Key. The examples below read different datasets through the same helper function.
import requests
BASE_URL = "https://api.twmarketdata.com"
HEADERS = {
"X-API-Key": "your_api_key_here",
}
def get_dataset(path, params):
response = requests.get(
f"{BASE_URL}{path}",
headers=HEADERS,
params=params,
)
response.raise_for_status()
return response.json()import requests
BASE_URL = "https://api.twmarketdata.com"
HEADERS = {"X-API-Key": "your_api_key_here"}
def get_dataset(path, params):
response = requests.get(
f"{BASE_URL}{path}",
headers=HEADERS,
params=params,
)
response.raise_for_status()
return response.json()
profile = get_dataset(
"/v2/datasets/issuer-profile",
{"symbol": "2330"},
)
print(profile)import requests
BASE_URL = "https://api.twmarketdata.com"
HEADERS = {"X-API-Key": "your_api_key_here"}
def get_dataset(path, params):
response = requests.get(
f"{BASE_URL}{path}",
headers=HEADERS,
params=params,
)
response.raise_for_status()
return response.json()
monthly_revenue = get_dataset(
"/v2/datasets/monthly-revenue",
{
"symbol": "2330",
"limit": 12,
},
)
print(monthly_revenue)import requests
BASE_URL = "https://api.twmarketdata.com"
HEADERS = {"X-API-Key": "your_api_key_here"}
def get_dataset(path, params):
response = requests.get(
f"{BASE_URL}{path}",
headers=HEADERS,
params=params,
)
response.raise_for_status()
return response.json()
income_statement = get_dataset(
"/v2/datasets/income-statement",
{"symbol": "2330", "limit": 4},
)
print(income_statement)import requests
BASE_URL = "https://api.twmarketdata.com"
HEADERS = {"X-API-Key": "your_api_key_here"}
def get_dataset(path, params):
response = requests.get(
f"{BASE_URL}{path}",
headers=HEADERS,
params=params,
)
response.raise_for_status()
return response.json()
balance_sheet = get_dataset(
"/v2/datasets/balance-sheet",
{"symbol": "2330", "limit": 4},
)
print(balance_sheet)import requests
BASE_URL = "https://api.twmarketdata.com"
HEADERS = {"X-API-Key": "your_api_key_here"}
def get_dataset(path, params):
response = requests.get(
f"{BASE_URL}{path}",
headers=HEADERS,
params=params,
)
response.raise_for_status()
return response.json()
cash_flow = get_dataset(
"/v2/datasets/cash-flow-statement",
{"symbol": "2330", "limit": 4},
)
print(cash_flow)import requests
BASE_URL = "https://api.twmarketdata.com"
HEADERS = {"X-API-Key": "your_api_key_here"}
def get_dataset(path, params):
response = requests.get(
f"{BASE_URL}{path}",
headers=HEADERS,
params=params,
)
response.raise_for_status()
return response.json()
valuation_data = get_dataset(
"/v2/datasets/valuation-data",
{"symbol": "2330", "limit": 4},
)
print(valuation_data)In practice: read the change in monthly revenue first, then the income statement and balance sheet, and use valuation data last to relate price back to the fundamentals.
company_name = (profile.get("rows") or [{}])[0].get("company_name")
latest_revenue_yoy = (monthly_revenue.get("rows") or [{}])[0].get("yoy_growth_pct")
latest_eps = (income_statement.get("rows") or [{}])[0].get("eps")
latest_per = (valuation_data.get("rows") or [{}])[0].get("per")
latest_pbr = (valuation_data.get("rows") or [{}])[0].get("pbr")
summary = {
"company_name": company_name,
"latest_revenue_yoy": latest_revenue_yoy,
"latest_eps": latest_eps,
"latest_per": latest_per,
"latest_pbr": latest_pbr,
}
print(summary)Datasets update on different cadences and disclose at different times. Before using them together, check each response's time fields, its range and its data_gaps.
TW Market Data preserves source role and gap information. Do not assume any dataset covers every date for every ticker.
With a fundamentals summary in place, the natural extensions are: