銘柄の週次信用残高
指定した銘柄の東証 週次信用取引残高(信用残)を申込日(週末基準日)の古い順で返す。weeks[] に買残 / 売残(各 合計・制度信用・一般信用の内訳)、信用倍率(= 買残合計 ÷ 売残合計)、前週比、週末終値、週合計出来高が入る。買残 / 売残 / 出来高 / 週末終値は最新株数基準へ分割・併合を遡及調整済みで、前週比も調整後の系列から算出する。買残 / 売残 / 出来高について取引所の公表値そのままが必要なときは *_reported を使う(公表当時の株数基準のため、分割・併合を跨ぐ期間の時系列比較には使えない)。週末終値は分割・併合調整後のみで、公表値版のフィールドは持たない。split_adjustment_status が undeterminable の銘柄は調整後フィールドが全週 null になるので *_reported を使う。split_events[] の ratio_text は約分しない表記で既約とは限らず小数も含む(10→20 / 1→1.1)ため、倍率が要るときは解析せず ratio を使う。取引所は東証(XTKS)固定。日次株価は GET /securities/{code}/prices で取得する。各数値プロパティの単位は fields[].unit を参照(対象は weeks[] と issued_shares_count)。split_events[].ratio は分割後株数 ÷ 分割前株数の倍率で、意味を同項目の説明に持たせているため fields[] の対象外。
GET
/securities/{code}/weekly-margin-balanceAuthorization
AuthorizationBearer token · headerrequiredIRBANK Connect (app.irbank.net/mcp-api) で発行した API キー
Path parameters
codestringrequired証券コード (4 桁)
matches ^[0-9A-Z]{4,5}$
Query parameters
periodstring取得期間 (26w=直近26週 / 52w=直近52週)。既定 52w
default: "52w"
Allowed:
26w52wResponses
200OK
fieldsobject[]required数値プロパティの単位メタデータ
Show propertiesHide properties
Array of
objectkeystringrequired対象数値プロパティのキー
labelstringrequired日本語の表示名
unitstringrequired単位識別子 (shares / times / jpy)
notestring補足 (任意)
security_codestringrequired証券コード (4 桁)
namestringrequired銘柄名
industry_namestringrequired業種名 (東証33業種)
issued_shares_countinteger | nullrequired発行済株式数 (株)。残高と同じ最新株数基準であると確認できた場合のみ値が入り、確認できないときは null (発行済比が算出できない)
split_adjustment_statusstringrequired銘柄単位の分割調整の状態。not-applicable=表示期間に効く分割・併合が記録されていない / applied=調整済み / undeterminable=分割イベントが株価段差と矛盾し調整できない (調整後フィールドが全週 null になるため *_reported を使う)
Allowed:
not-applicableappliedundeterminablesplit_eventsWeeklyMarginSplitEventExternal[]required表示期間の値に効いた分割・併合 (rights_last_date 昇順)。表示期間より後に権利落ちしたもの (applied_from_report_date が null) も含む。要素が入るのは split_adjustment_status が applied のときだけで、それ以外は空配列 (undeterminable はどのイベントが実在するか判定できないため返さない)
Show propertiesHide properties
Array of
WeeklyMarginSplitEventExternalrights_last_datestringrequired権利付最終日 (YYYY-MM-DD)
effective_datestringrequired効力発生日 (YYYY-MM-DD)
ratio_textstringrequired開示表記の比率。前後の空白を除いた取引所の表記で、約分はしないため既約とは限らず小数も含む (10→20 / 1→1.1)。取引所が表記を持たない行は分割前後の株数から組み立てる。数値が要るときは解析せず ratio を使う
rationumberrequired1 株あたりの倍率 (分割後株数 ÷ 分割前株数)。分割は 1 より大きく、併合は 1 未満
kindstringrequired分割 (株数が増える) か併合 (減る) か
Allowed:
splitconsolidationapplied_from_report_datestring | nullrequiredこの分割が反映された最初の週の report_date。権利落ちが表示期間より後なら null
exchangestringrequired取引所 (東証固定、ISO MIC)
Allowed:
XTKSperiodstringrequired適用した期間
Allowed:
26w52wweeksWeeklyMarginBalanceWeek[]required週次信用残高。report_date 昇順 (古→新)
Show propertiesHide properties
Array of
WeeklyMarginBalanceWeekreport_datestringrequired申込日 (週末基準日、YYYY-MM-DD)
buy_balance_totalinteger | nullrequired買残 合計 (株、最新株数基準へ分割・併合調整後)
buy_balance_regulatedinteger | nullrequired買残 制度信用 (株、調整後)
buy_balance_generalinteger | nullrequired買残 一般信用 (株、調整後)
sell_balance_totalinteger | nullrequired売残 合計 (株、最新株数基準へ分割・併合調整後)
sell_balance_regulatedinteger | nullrequired売残 制度信用 (株、調整後)
sell_balance_generalinteger | nullrequired売残 一般信用 (株、調整後)
buy_balance_total_reportedintegerrequired買残 合計 (株、取引所公表値・当時の株数基準)
buy_balance_regulated_reportedintegerrequired買残 制度信用 (株、取引所公表値)
buy_balance_general_reportedintegerrequired買残 一般信用 (株、取引所公表値)
sell_balance_total_reportedintegerrequired売残 合計 (株、取引所公表値・当時の株数基準)
sell_balance_regulated_reportedintegerrequired売残 制度信用 (株、取引所公表値)
sell_balance_general_reportedintegerrequired売残 一般信用 (株、取引所公表値)
split_adjustment_factornumber | nullrequired当該週に適用した分割・併合の累積調整係数。取引所公表値 × この値 = 調整後の値。調整が不要な週は 1、調整できない銘柄は null
margin_rationumber | nullrequired信用倍率 = 買残合計 ÷ 売残合計。売残合計が 0 の週は null
buy_balance_changeinteger | nullrequired買残の前週比 (株、調整後どうしの差)。前週の行が取得できない週 (収録の開始に達した最古週) と、調整できない銘柄は null。period より長く収録がある銘柄では、返す最古週の前週比も period が返す範囲の 1 週前にある行から算出する
sell_balance_changeinteger | nullrequired売残の前週比 (株、調整後どうしの差)。前週の行が取得できない週 (収録の開始に達した最古週) と、調整できない銘柄は null。period より長く収録がある銘柄では、返す最古週の前週比も period が返す範囲の 1 週前にある行から算出する
close_pricenumber | nullrequired週末終値 (円、当該週の最終取引日、分割・併合調整後)。当該週に取引日が無い / 調整できない銘柄は null
volumeinteger | nullrequired週合計出来高 (株、最新株数基準へ調整後)
volume_reportedinteger | nullrequired週合計出来高 (株、取引所公表値の単純合計)
attributionAttributionrequiredShow propertiesHide properties
source_labelstringrequired出典表示ラベル(第三者に表示する際はこの表記を使う)
license_notestringrequired出典・再配信条件の注記
processed_bystringrequired400パラメータが不正
errorobjectrequiredShow propertiesHide properties
codestringrequiredmessagestringrequireddetailsExternalErrorDetail[]Show propertiesHide properties
Array of
ExternalErrorDetailparamstringrequiredreasonstringrequiredAllowed:
missingconflictinvalid_typeinvalid_formatout_of_rangeunknown_valuetoo_many_itemsinvalidexpectedstring受理される値の要約(範囲・型・列挙値)。示せない場合は省略する
404銘柄が存在しない、または東証の週次信用残高データが 1 件も無い
errorobjectrequiredShow propertiesHide properties
codestringrequiredmessagestringrequireddetailsExternalErrorDetail[]Show propertiesHide properties
Array of
ExternalErrorDetailparamstringrequiredreasonstringrequiredAllowed:
missingconflictinvalid_typeinvalid_formatout_of_rangeunknown_valuetoo_many_itemsinvalidexpectedstring受理される値の要約(範囲・型・列挙値)。示せない場合は省略する
Request
curl -X GET "https://api.irbank.net/v1/securities/7203/weekly-margin-balance" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://api.irbank.net/v1/securities/7203/weekly-margin-balance", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});import requests
response = requests.get(
"https://api.irbank.net/v1/securities/7203/weekly-margin-balance",
headers={
"Authorization": "Bearer YOUR_TOKEN"
},
)Response
{
"fields": [
{
"key": "string",
"label": "string",
"unit": "string",
"note": "string"
}
],
"security_code": "7203",
"name": "string",
"industry_name": "string",
"issued_shares_count": 0,
"split_adjustment_status": "not-applicable",
"split_events": [
{
"rights_last_date": "2025-12-29",
"effective_date": "2026-01-01",
"ratio_text": "1→15",
"ratio": 15,
"kind": "split",
"applied_from_report_date": "string"
}
],
"exchange": "XTKS",
"period": "26w",
"weeks": [
{
"report_date": "2026-02-27",
"buy_balance_total": 0,
"buy_balance_regulated": 0,
"buy_balance_general": 0,
"sell_balance_total": 0,
"sell_balance_regulated": 0,
"sell_balance_general": 0,
"buy_balance_total_reported": 0,
"buy_balance_regulated_reported": 0,
"buy_balance_general_reported": 0,
"sell_balance_total_reported": 0,
"sell_balance_regulated_reported": 0,
"sell_balance_general_reported": 0,
"split_adjustment_factor": 0,
"margin_ratio": 0,
"buy_balance_change": 0,
"sell_balance_change": 0,
"close_price": 0,
"volume": 0,
"volume_reported": 0
}
],
"attribution": {
"source_label": "金融庁 EDINET / TDnet",
"license_note": "string",
"processed_by": "IRBANK"
}
}{
"error": {
"code": "not_found",
"message": "Security not found",
"details": [
{
"param": "years",
"reason": "out_of_range",
"expected": ">= 1"
}
]
}
}{
"error": {
"code": "not_found",
"message": "Security not found",
"details": [
{
"param": "years",
"reason": "out_of_range",
"expected": ">= 1"
}
]
}
}