From sec-apis
Integrate with Thailand SEC OpenAPI for mutual funds, fund daily data, bonds, license checks, digital assets, PVD factsheets, One Report, and reference data. Use when calling api.sec.or.th, working with SEC subscription keys, retrieving Thai capital-market datasets, or building Python clients for SEC API products.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sec-apis:sec-apisThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Thailand SEC OpenAPI publishes machine-readable datasets from the Securities and Exchange Commission, Thailand. The APIs require product-specific subscription keys from the SEC API Portal and use `Ocp-Apim-Subscription-Key` authentication.
Thailand SEC OpenAPI publishes machine-readable datasets from the Securities and Exchange Commission, Thailand. The APIs require product-specific subscription keys from the SEC API Portal and use Ocp-Apim-Subscription-Key authentication.
Use the SEC API Portal to subscribe to products, get keys, inspect schemas, and confirm parameter formats. Send the product key in every request:
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Cache-Control": "no-cache",
"Ocp-Apim-Subscription-Key": SEC_API_KEY,
}
Use separate environment variables for separate products, such as SEC_FUND_FACTSHEET_KEY, SEC_FUND_DAILY_INFO_KEY, and SEC_COMMON_KEY. Never hard-code keys, commit .env files, or print subscription keys in logs.
SEC APIs are rate limited. Use a practical ceiling of about 5 calls per second unless the API Portal specifies otherwise. Add throttling around loops, especially when iterating all AMCs or all funds.
import time
import requests
def sec_get(url: str, api_key: str):
headers = {
"Accept": "application/json",
"Ocp-Apim-Subscription-Key": api_key,
}
response = requests.get(url, headers=headers, timeout=30)
response.raise_for_status()
time.sleep(0.25)
return response.json()
Before writing custom code, identify the SEC product family, required subscription key, endpoint path, and identifier format (unique_id, proj_id, period, trade_date, or issued_ref_id).
GET /FundFactsheet/fund/amc to list AMCs and get unique_id.unique_id, call GET /FundFactsheet/fund/amc/{unique_id}.pandas.DataFrame and filter by fields like fund_status, regis_date, proj_id, or proj_abbr_name.Build amc = DataFrame(GET /fund/amc), loop through amc["unique_id"], then concatenate each GET /fund/amc/{unique_id} response.
Use POST /FundFactsheet/fund with {"name": "..."} when the input is a fund abbreviation or partial name rather than an AMC unique_id.
Use the fund proj_id for factsheet detail endpoints such as URLs, policy, asset, performance, fee, FundPort/{period}, FundFullPort/{period}, and FundTop5/{period}.
Use GET /FundDailyInfo/{proj_id}/dailynav/{nav_date}. Confirm the expected nav_date format from the API Portal for the subscribed product before implementing production code.
See API catalog for endpoint families and common use cases. Product families covered: Fund Factsheet, Fund Daily Info, Common references, License Check, Bond, Digital Asset, PVD Factsheet, and One Report references.
response.raise_for_status() and log the URL/status for non-200 responses.pd.concat, not deprecated DataFrame.append, when accumulating records.429 and 5xx responses, but do not bypass rate limits.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub thunder121x/skills-factory --plugin sec-apis