From bbad574b25703dec32b3a918c80e056f7464efbf Mon Sep 17 00:00:00 2001 From: Ryo Okubo Date: Tue, 6 May 2025 17:18:30 +0900 Subject: [PATCH 1/8] Add env config and move schema definitions to separate file --- .env.sample | 2 ++ src/index.ts | 53 ++++++++++++++++++-------------------------------- src/schemas.ts | 39 +++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 34 deletions(-) create mode 100644 src/schemas.ts diff --git a/.env.sample b/.env.sample index e69de29..e98beaa 100644 --- a/.env.sample +++ b/.env.sample @@ -0,0 +1,2 @@ +# for testing, ref. https://docs.buffett-code.com/api/#section/%E8%AA%8D%E8%A8%BC/API +BUFFETT_CODE_API_KEY=sAJGq9JH193KiwnF947v74KnDYkO7z634LWQQfPY \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index af28379..573fd71 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,45 +7,30 @@ import { import { Server } from '@modelcontextprotocol/sdk/server/index.js'; import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; import { zodToJsonSchema } from 'zod-to-json-schema'; -import { z } from 'zod'; +// import { z } from 'zod'; +import dotenv from 'dotenv'; +dotenv.config(); const BUFFETT_CODE_BASE_URL = 'https://api.buffett-code.com'; -// for testing, ref. https://docs.buffett-code.com/api/#section/%E8%AA%8D%E8%A8%BC/API -const BUFFETT_CODE_API_KEY = 'sAJGq9JH193KiwnF947v74KnDYkO7z634LWQQfPY'; -// Alphabet Inc. -const COMPANY_ID = '0001652044'; - -const BaseRequestSchema = z.object({}); - -const CompanyDailyRequestSchema = z.object({ - date: z - .string() - .regex(/^\d{4}-\d{2}-\d{2}$/, 'RFC3339形式の日付 (例: 2024-01-01)'), -}); - -const CompanyQuarterlyRequestSchema = z.object({ - year_quarter: z - .string() - .regex(/^\d{4}Q\d$/, '決算期を示す決算年度年と四半期 (例: 2020Q4)'), -}); -const CompanyStocksRequestSchema = z.object({ - stock_id: z.string().regex(/^[a-z]+$/, '銘柄コード (例: goog)'), -}); +const BUFFETT_CODE_API_KEY = process.env.BUFFETT_CODE_API_KEY; +if (!BUFFETT_CODE_API_KEY) { + throw new Error( + 'BUFFETT_CODE_API_KEY is required. Set it in your environment or .env file.' + ); +} -const CompanyStocksDailyRequestSchema = z.object({ - stock_id: z.string().regex(/^[a-z]+$/, '銘柄コード (例: goog)'), - date: z - .string() - .regex(/^\d{4}-\d{2}-\d{2}$/, 'RFC3339形式の日付 (例: 2024-01-01)'), -}); +// Alphabet Inc. +const COMPANY_ID = '0001652044'; -const CompanyStocksQuarterlyRequestSchema = z.object({ - stock_id: z.string().regex(/^[a-z]+$/, '銘柄コード (例: goog)'), - year_quarter: z - .string() - .regex(/^\d{4}Q\d$/, '決算期を示す決算年度年と四半期 (例: 2020Q4)'), -}); +import { + BaseRequestSchema, + CompanyDailyRequestSchema, + CompanyQuarterlyRequestSchema, + CompanyStocksRequestSchema, + CompanyStocksDailyRequestSchema, + CompanyStocksQuarterlyRequestSchema, +} from './schemas.js'; const server = new Server( { diff --git a/src/schemas.ts b/src/schemas.ts new file mode 100644 index 0000000..36f0b75 --- /dev/null +++ b/src/schemas.ts @@ -0,0 +1,39 @@ +import { z } from 'zod'; + +export const BaseRequestSchema = z.object({}); + +export const CompanyDailyRequestSchema = z.object({ + date: z + .string() + .regex( + /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/, + 'RFC3339形式の日付 (例: 2024-01-01)' + ), +}); + +export const CompanyQuarterlyRequestSchema = z.object({ + year_quarter: z + .string() + .regex(/^[0-9]{4}Q[0-9]$/, '決算期を示す決算年度年と四半期 (例: 2020Q4)'), +}); + +export const CompanyStocksRequestSchema = z.object({ + stock_id: z.string().regex(/^[a-z]+$/, '銘柄コード (例: goog)'), +}); + +export const CompanyStocksDailyRequestSchema = z.object({ + stock_id: z.string().regex(/^[a-z]+$/, '銘柄コード (例: goog)'), + date: z + .string() + .regex( + /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/, + 'RFC3339形式の日付 (例: 2024-01-01)' + ), +}); + +export const CompanyStocksQuarterlyRequestSchema = z.object({ + stock_id: z.string().regex(/^[a-z]+$/, '銘柄コード (例: goog)'), + year_quarter: z + .string() + .regex(/^[0-9]{4}Q[0-9]$/, '決算期を示す決算年度年と四半期 (例: 2020Q4)'), +}); From fd75535fccdd27f43d6973f0810d7fd1c63d330c Mon Sep 17 00:00:00 2001 From: Ryo Okubo Date: Tue, 6 May 2025 23:56:50 +0900 Subject: [PATCH 2/8] feat: add OpenAPI client and make company ID configurable --- .env.sample | 1 + package-lock.json | 302 +++ package.json | 5 +- scripts/generate-client.sh | 12 + src/client/api.ts | 4908 ++++++++++++++++++++++++++++++++++++ src/client/index.ts | 11 + src/index.ts | 182 +- src/schemas.ts | 9 + 8 files changed, 5338 insertions(+), 92 deletions(-) create mode 100755 scripts/generate-client.sh create mode 100644 src/client/api.ts create mode 100644 src/client/index.ts diff --git a/.env.sample b/.env.sample index e98beaa..317b096 100644 --- a/.env.sample +++ b/.env.sample @@ -1,2 +1,3 @@ +BUFFETT_CODE_BASE_URL=https://api.buffett-code.com # for testing, ref. https://docs.buffett-code.com/api/#section/%E8%AA%8D%E8%A8%BC/API BUFFETT_CODE_API_KEY=sAJGq9JH193KiwnF947v74KnDYkO7z634LWQQfPY \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4bab945..54839e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@modelcontextprotocol/sdk": "^1.0.4", "@types/node": "^20.10.3", "dotenv": "^16.4.7", + "openapi-fetch": "^0.13.7", "typescript": "^5.3.2", "zod": "^3.22.4", "zod-to-json-schema": "^3.22.4" @@ -25,12 +26,38 @@ "@typescript-eslint/parser": "^6.19.0", "eslint": "^8.17.0", "eslint-config-prettier": "^9.1.0", + "openapi-typescript": "^7.7.1", "prettier": "^3.2.2", "shx": "^0.3.4", "ts-node": "^10.9.2", "tsx": "^4.19.3" } }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -705,6 +732,72 @@ "node": ">= 8" } }, + "node_modules/@redocly/ajv": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/@redocly/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-io1JpnwtIcvojV7QKDUSIuMN/ikdOUd1ReEnUnMKGfDVridQZ31J0MmIuqwuRjWDZfmvr+Q0MqCcfHM2gTivOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js-replace": "^1.0.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@redocly/ajv/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, + "node_modules/@redocly/config": { + "version": "0.22.2", + "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.22.2.tgz", + "integrity": "sha512-roRDai8/zr2S9YfmzUfNhKjOF0NdcOIqF7bhf4MVC5UxpjIysDjyudvlAiVbpPHp3eDRWbdzUgtkK1a7YiDNyQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@redocly/openapi-core": { + "version": "1.34.2", + "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.34.2.tgz", + "integrity": "sha512-glfkQFJizLdq2fBkNvc2FJW0sxDb5exd0wIXhFk+WHaFLMREBC3CxRo2Zq7uJIdfV9U3YTceMbXJklpDfmmwFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@redocly/ajv": "^8.11.2", + "@redocly/config": "^0.22.0", + "colorette": "^1.2.0", + "https-proxy-agent": "^7.0.5", + "js-levenshtein": "^1.1.6", + "js-yaml": "^4.1.0", + "minimatch": "^5.0.1", + "pluralize": "^8.0.0", + "yaml-ast-parser": "0.0.43" + }, + "engines": { + "node": ">=18.17.0", + "npm": ">=9.5.0" + } + }, + "node_modules/@redocly/openapi-core/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@tsconfig/node10": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", @@ -1020,6 +1113,16 @@ "node": ">=0.4.0" } }, + "node_modules/agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -1037,6 +1140,16 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -1202,6 +1315,13 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/change-case": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", + "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", + "dev": true, + "license": "MIT" + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1222,6 +1342,13 @@ "dev": true, "license": "MIT" }, + "node_modules/colorette": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", + "dev": true, + "license": "MIT" + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2184,6 +2311,20 @@ "node": ">= 0.8" } }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -2233,6 +2374,19 @@ "node": ">=0.8.19" } }, + "node_modules/index-to-position": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-1.1.0.tgz", + "integrity": "sha512-XPdx9Dq4t9Qk1mTMbWONJqU7boCoumEH7fRET37HX5+khDUl3J2W6PdALxhILYlIYx2amlwYcRPp28p0tSiojg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -2341,6 +2495,23 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "license": "ISC" }, + "node_modules/js-levenshtein": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -2594,6 +2765,55 @@ "wrappy": "1" } }, + "node_modules/openapi-fetch": { + "version": "0.13.7", + "resolved": "https://registry.npmjs.org/openapi-fetch/-/openapi-fetch-0.13.7.tgz", + "integrity": "sha512-3QdcAgvLFZ4j9Rcja7/Tq1j0qyv/LPqnHzwtMz5gKj6iddTdP48r+FZd8rmb+6xL9CdnJ5OmgdM0CpgGBi6Fgg==", + "license": "MIT", + "dependencies": { + "openapi-typescript-helpers": "^0.0.15" + } + }, + "node_modules/openapi-typescript": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/openapi-typescript/-/openapi-typescript-7.7.1.tgz", + "integrity": "sha512-apa45jEOxcVfYHTD9eHpW0cR8yQn7jQFTCnSWNdjKbWmyjha8CMj1LdGHdk0Z70kFSR6EfjdDuOCY7PFICrNSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@redocly/openapi-core": "^1.34.2", + "ansi-colors": "^4.1.3", + "change-case": "^5.4.4", + "parse-json": "^8.3.0", + "supports-color": "^9.4.0", + "yargs-parser": "^21.1.1" + }, + "bin": { + "openapi-typescript": "bin/cli.js" + }, + "peerDependencies": { + "typescript": "^5.x" + } + }, + "node_modules/openapi-typescript-helpers": { + "version": "0.0.15", + "resolved": "https://registry.npmjs.org/openapi-typescript-helpers/-/openapi-typescript-helpers-0.0.15.tgz", + "integrity": "sha512-opyTPaunsklCBpTK8JGef6mfPhLSnyy5a0IN9vKtx3+4aExf+KxEqYwIy3hqkedXIB97u357uLMJsOnm3GVjsw==", + "license": "MIT" + }, + "node_modules/openapi-typescript/node_modules/supports-color": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz", + "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -2657,6 +2877,37 @@ "node": ">=6" } }, + "node_modules/parse-json": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.3.0.tgz", + "integrity": "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "index-to-position": "^1.1.0", + "type-fest": "^4.39.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse-json/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -2721,6 +2972,13 @@ "node": ">=8" } }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -2743,6 +3001,16 @@ "node": ">=16.20.0" } }, + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -2864,6 +3132,16 @@ "node": ">= 0.10" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve": { "version": "1.22.10", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", @@ -3438,6 +3716,13 @@ "punycode": "^2.1.0" } }, + "node_modules/uri-js-replace": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uri-js-replace/-/uri-js-replace-1.0.1.tgz", + "integrity": "sha512-W+C9NWNLFOoBI2QWDp4UT9pv65r2w5Cx+3sTYFvtMdDBxkKt1syCqsUdSFAChbEe1uK5TfS04wt/nGwmaeIQ0g==", + "dev": true, + "license": "MIT" + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -3485,6 +3770,23 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC" }, + "node_modules/yaml-ast-parser": { + "version": "0.0.43", + "resolved": "https://registry.npmjs.org/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz", + "integrity": "sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", diff --git a/package.json b/package.json index 8cd26a3..c95536e 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,7 @@ "lint:prettier": "prettier --check \"src/**/*.ts\"", "fix": "npm run fix:eslint && npm run fix:prettier", "fix:eslint": "eslint \"src/**/*.ts\" --fix", - "fix:prettier": "prettier --write \"src/**/*.ts\"", - "examples": "node --import ./ts-node-loader.js examples/export_page.ts" + "fix:prettier": "prettier --write \"src/**/*.ts\"" }, "repository": { "type": "git", @@ -42,6 +41,7 @@ "@modelcontextprotocol/sdk": "^1.0.4", "@types/node": "^20.10.3", "dotenv": "^16.4.7", + "openapi-fetch": "^0.13.7", "typescript": "^5.3.2", "zod": "^3.22.4", "zod-to-json-schema": "^3.22.4" @@ -52,6 +52,7 @@ "@typescript-eslint/parser": "^6.19.0", "eslint": "^8.17.0", "eslint-config-prettier": "^9.1.0", + "openapi-typescript": "^7.7.1", "prettier": "^3.2.2", "shx": "^0.3.4", "ts-node": "^10.9.2", diff --git a/scripts/generate-client.sh b/scripts/generate-client.sh new file mode 100755 index 0000000..81fb88a --- /dev/null +++ b/scripts/generate-client.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Create necessary directories +mkdir -p src + +# Download the OpenAPI specification +# curl -f -o scripts/openapi.yml https://docs.buffett-code.com/assets/openapi.yml + +# Generate TypeScript types from OpenAPI spec +# npx openapi-typescript scripts/openapi.yml -o src/client/api.ts + +npx openapi-typescript https://docs.buffett-code.com/assets/openapi.yml -o src/client/api.ts \ No newline at end of file diff --git a/src/client/api.ts b/src/client/api.ts new file mode 100644 index 0000000..2b0841c --- /dev/null +++ b/src/client/api.ts @@ -0,0 +1,4908 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + +export interface paths { + '/api/v4/jp/documents/search': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * 資料検索API + * @description 資料を検索するAPIです。 + * 検索結果に含まれるドキュメントIDと[資料ダウンロードリンク生成API](#operation/post-api-v4-jp-document-download-link)を用いて、資料のダウンロードリンクを作成できます。 + * + * 現在、テスト用のAPIキーでは利用できません。 + * + */ + post: operations['post-api-v4-jp-document-search']; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/jp/documents/{doc_id}/download_link': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * 資料ダウンロードリンク生成API + * @description 資料ダウンロードリンク生成するAPIです。 + * ダウンロードリンクには有効期限があります。 + * + * 現在、テスト用のAPIキーでは利用できません。 + */ + post: operations['post-api-v4-jp-document-download-link']; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/jp/companies/{company_id}': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 企業・銘柄情報API + * @description 企業・銘柄情報を取得するためのAPIです。 + * + * テスト用のAPIキーの場合は末尾が`01`の銘柄コードを持つ企業・銘柄情報のみ取得可能です。 + */ + get: operations['get-api-v4-jp-companies-show']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/jp/companies/{company_id}/daily/{date}': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 日次指標取得API + * @description 企業・銘柄の日付ベースで計算された指標を返します。 + * 主に株価関連の指標や不定期更新される財務数値が含まれています。 + * 指定された日付に対して対象企業の株価が存在しない場合、`404 Not Found` が返されます。 + * + * テスト用のAPIキーの場合は末尾が`01`の銘柄コードを持つ企業・銘柄のみ取得可能です。 + */ + get: operations['get-api-v4-jp-companies-daily-show']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/jp/companies/{company_id}/daily/{date}/market_reaction': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 日次市場リアクション取得API + * @description 銘柄ごとの日次ベースの市場の反応を、株価の変動率とテキストとして返します。 + * 現在は、決算について反応を論じるに十分なデータが存在する銘柄に関して、四半期もしくは本決算発表日の反応のみ取得可能です。 + * + * 具体的な取得可能日については[メタデータダウンロードリンク生成API](https://www.buffett-code.com/docs/api/v4/metadata/post-api-v4-metadata-download-link)の `"jp-company-resource-last-updates"` を参照してください。また、各銘柄の「四半期もしくは本決算発表日」は[四半期財務数値取得API](https://docs.buffett-code.com/api/#tag/v4-jp/operation/get-api-v4-jp-companies-quarterly-show)の `first_published_at` を参照することでも取得可能です。 + * + * テスト用のAPIキーの場合は末尾が`01`の銘柄コードを持つ企業・銘柄のみ取得可能です。 + */ + get: operations['get-api-v4-jp-companies-daily-market-reaction-index']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/jp/companies/{company_id}/weekly/{year_week}/stats': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 週次統計取得API + * @description 企業・銘柄の週ベースで計算された統計を返します。主に株価関連の統計が含まれています。 + * + * テスト用のAPIキーの場合は末尾が`01`の銘柄コードを持つ企業・銘柄のみ取得可能です。 + */ + get: operations['get-api-v4-jp-companies-weekly-stats-index']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/jp/companies/{company_id}/monthly/{year_month}/stats': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 月次統計取得API + * @description 企業・銘柄の月ベースで計算された統計を返します。主に株価関連の統計が含まれています。 + * + * テスト用のAPIキーの場合は末尾が`01`の銘柄コードを持つ企業・銘柄のみ取得可能です。 + */ + get: operations['get-api-v4-jp-companies-monthly-stats-index']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/jp/companies/{company_id}/monthly/{year_month}/kpis': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 月次重要業績評価指標取得API + * @description 企業・銘柄の月ごとの重要業績評価指標(KPI)を返します。 + * + * テスト用のAPIキーの場合は末尾が`01`の銘柄コードを持つ企業・銘柄のみ取得可能です。 + */ + get: operations['get-api-v4-jp-companies-monthly-kpis-index']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/jp/companies/{company_id}/quarterly/{year_quarter}': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 四半期財務数値取得API + * @description 企業・銘柄の四半期決算ベースの財務数値と、その財務数値の属する決算のメタデータ(開示日や会計基準など)を返します。 + * + * このエンドポイントのデータは、企業の開示する決算短信・有価証券報告書(四半期報告書)ならびに業績予想の修正、さらに決算短信・有報の訂正に応じて逐次更新されます。特別な記述がない場合、各フィールドは最も新しい値を返します。 + * 例えば、決算短信に記載された売上予想がその後に発表された業績予想の修正で変更された場合、該当のフィールド `ex_net_sales` は業績予想の修正後の値を示します。同様に、決算短信の値がその後に開示された有報の値が異なる場合、該当のフィールドは有報の値を返します。 + * + * なお、一部の財務数値は決算短信では値が開示されず、有報にのみ記載されているものがあります。それらについては、該当決算に対応する有報が開示されるまで `null` を返します。 + * + * 該当四半期の最初の開示日、最新の開示日はそれぞれ `first_published_at` と `updated_date` で取得できます。 + * `updated_date` と `first_published_at` が同じ日付の場合、該当四半期の開示が一度しか行われていないことを示します。 + * 同様に、 `first_ex_net_sales` などの `first_` をプレフィックスに持つフィールドはその四半期における最初の開示の値を、 + * `ex_net_sales` のようにプレフィックスがないフィールドはその四半期における最新の開示の値を指します。 + * + * テスト用のAPIキーの場合は末尾が`01`の銘柄コードを持つ企業・銘柄のみ取得可能です。 + */ + get: operations['get-api-v4-jp-companies-quarterly-show']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/jp/companies/{company_id}/quarterly/{year_quarter}/affiliated_companies': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 四半期関係会社取得API + * @description **本機能はベータ版のため、リクエスト、レスポンスの仕様を一部変更する可能性があります。** + * 企業・銘柄の四半期ベースの関係会社を返します。 + * + * テスト用のAPIキーの場合は末尾が`01`の銘柄コードを持つ企業・銘柄のみ取得可能です。 + */ + get: operations['get-api-v4-jp-companies-quarterly-affiliated-companies-index']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/jp/companies/{company_id}/quarterly/{year_quarter}/major_facilities': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 四半期関連設備取得API + * @description **本機能はベータ版のため、リクエスト、レスポンスの仕様を一部変更する可能性があります。** + * 企業・銘柄の四半期ベースの関連設備を返します。 + * + * テスト用のAPIキーの場合は末尾が`01`の銘柄コードを持つ企業・銘柄のみ取得可能です。 + */ + get: operations['get-api-v4-jp-companies-quarterly-major-facilities-index']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/jp/companies/{company_id}/quarterly/{year_quarter}/long_text_content': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 四半期テキスト情報取得API + * @description 有価証券報告書もしくは四半期報告書にHTMLとして記載されたテキストを元に、バフェット・コードで加工したものを返します。 + * このテキスト処理のアルゴリズムは、予告なく変更される場合があります。 + * + * テスト用のAPIキーの場合は末尾が`01`の銘柄コードを持つ企業・銘柄のみ取得可能です。 + */ + get: operations['get-api-v4-jp-companies-quarterly-long-text-content-show']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/jp/companies/{company_id}/quarterly/{year_quarter}/major_shareholders': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 四半期大株主取得API + * @description 企業・銘柄の有価証券報告書もしくは四半期報告書に記載された大株主情報を返します。 + * + * 以下の点に留意してください。 + * + * - 個人情報保護の観点から、必要に応じて匿名化処理を行っています。 + * - ほとんどの企業では、第1、第3四半期報告書は大株主の開示がされません。 + * - 現時点では、該当四半期において上場している企業のみがデータが取得可能です。 + * + * テスト用のAPIキーの場合は末尾が`01`の銘柄コードを持つ企業・銘柄のみ取得可能です。 + */ + get: operations['get-api-v4-jp-companies-quarterly-major-shareholders-index']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/jp/companies/{company_id}/quarterly/{year_quarter}/segments': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 四半期セグメント取得API + * @description 企業・銘柄の有価証券報告書もしくは四半期報告書に記載されたセグメント情報を返します。 + * + * テスト用のAPIキーの場合は末尾が`01`の銘柄コードを持つ企業・銘柄のみ取得可能です。 + */ + get: operations['get-api-v4-jp-companies-quarterly-segments-index']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/jp/companies/{company_id}/annually/{fiscal_year}/guidance_revisions': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 決算年度別業績予想の修正一覧取得API + * @description 企業・銘柄の決算年度ごとの業績予想の修正一覧を返します。 + * + * テスト用のAPIキーの場合は末尾が`01`の銘柄コードを持つ企業・銘柄のみ取得可能です。 + */ + get: operations['get-api-v4-jp-companies-annually-guidance-revisions-index']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/jp/companies/{company_id}/similarities': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 類似企業一覧取得API + * @description 指定された企業から見て類似している企業の一覧を返します。 + * + * テスト用のAPIキーの場合は末尾が`01`の銘柄コードを持つ企業・銘柄のみ取得可能です。 + */ + get: operations['get-api-v4-jp-companies-similarities-index']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/us/companies/{company_id}': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 企業情報取得API + * @description 企業情報を取得するためのAPIです。 + * + * テスト用のAPIキーの場合はAlphabet Inc.(CIK: `0001652044`)のみ取得可能です。 + */ + get: operations['get-api-v4-us-companies-show']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/us/companies/{company_id}/daily/{date}': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 日次株価指標取得API + * @description 企業の日付ベースで計算された指標を返します。 + * 指定された日付に対して対象企業の株価が存在しない場合、`404 Not Found` が返されます。 + * + * テスト用のAPIキーの場合はAlphabet Inc.(CIK: `0001652044`)のみ取得可能です。 + */ + get: operations['get-api-v4-us-companies-daily-show']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/us/companies/{company_id}/quarterly/{year_quarter}': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 四半期財務数値取得API + * @description 企業の四半期ベースの財務数値を返します。 + * + * テスト用のAPIキーの場合はAlphabet Inc.(CIK: `0001652044`)のみ取得可能です。 + */ + get: operations['get-api-v4-us-companies-quarterly-show']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/us/companies/{company_id}/stocks/{stock_id}': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 銘柄情報取得API + * @description 銘柄情報を返します。 + * + * テスト用のAPIキーの場合はAlphabet Inc.(CIK: `0001652044`)のみ取得可能です。 + */ + get: operations['get-api-v4-us-companies-stocks-show']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/us/companies/{company_id}/stocks/{stock_id}/daily/{date}': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 銘柄日次株価指標取得API + * @description 銘柄の日付ベースで計算された指標を返します。 + * 主に株価関連の指標や不定期更新される財務数値が含まれています。 + * 指定された日付に対して対象銘柄の株価が存在しない場合、`404 Not Found` が返されます。 + * + * テスト用のAPIキーの場合はAlphabet Inc.(CIK: `0001652044`)のみ取得可能です。 + */ + get: operations['get-api-v4-us-companies-stocks-daily-show']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/us/companies/{company_id}/stocks/{stock_id}/quarterly/{year_quarter}': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * 銘柄四半期株価指標取得API + * @description 銘柄の四半期ベースで計算された指標を返します。 + * + * テスト用のAPIキーの場合はAlphabet Inc.(CIK: `0001652044`)のみ取得可能です。 + */ + get: operations['get-api-v4-us-companies-stocks-quarterly-show']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/v4/metadata/{name}/download_link': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * メタデータダウンロードリンク生成API + * @description v4のエンドポイントで扱っている企業・銘柄の一覧と、財務数値の更新日などのメタデータを取得するためのエンドポイントです。 + * エンドポイントが実行されるとダウンロードリンクが発行され、有効期限内のみ利用できます。 + * + * エンドポイントの `name` パラメータに応じて、以下のデータが取得可能です。 + * + * | `name` パラメータ | 概要 | + * |-------------------|------| + * | `jp-company-list` | v4で扱っている日本企業の企業ID・企業名・法人番号・銘柄コードの一覧。
ZIP形式で圧縮済みの、以下のような行を含むTSVファイルとして提供されます。
9KOXA5KFX2	トヨタ自動車株式会社	1180301018771	7203
| + * | `us-company-list` | v4で扱っている米国企業のCIKコード・企業名・銘柄コードの一覧。
ZIP形式で圧縮済みの、以下のような行を含むTSVファイルとして提供されます。
0001652044	Alphabet Inc.	GOOG
| + * | `jp-company-resource-last-updates` | v4で扱っている日本企業の日次・週次・月次・四半期データの最終更新日一覧。
ZIP形式で圧縮された、以下のような行を含む企業IDごとのTSVファイルで提供されます。
/api/v4/jp/companies/9koxa5kfx2	2024-08-02T10:10:31.317187+00:00
| + * | `us-company-resource-last-updates` | v4で扱っている米国企業および銘柄の日次・四半期データの最終更新日一覧。
ZIP形式で圧縮された、以下のような行を含むCIKコードごとのTSVファイルで提供されます。
/api/v4/jp/companies/0001652044	2024-08-02T10:10:31.317187+00:00
| + * + * 現在、テスト用のAPIキーでは利用できません。 + * + * **データ形式の破壊的変更について(2025年3月3日更新)** + * + * 本エンドポイントで提供しているデータのうち、互換性に影響がある形で下記2つのカタログデータを変更します。 + * + * - `jp-company-resource-last-updates` + * - `us-company-resource-last-updates` + * + * 変更点はどちらも「四半期財務数値取得」リソースの表記です。 + * これまで、歴史的経緯により、以下のように`quarter`と`quarterly`の2つのエンドポイントを併記しておりました。 + * + * ``` + * /api/v4/jp/companies/{company_id}/quarter/2022Q4 + * /api/v4/jp/companies/{company_id}/quarterly/2022Q4 + * ``` + * + * ``` + * /api/v4/us/companies/{company_id}/quarter/2020Q1 + * /api/v4/us/companies/{company_id}/quarterly/2020Q1 + * ``` + * + * これを、2025年5月1日以降、API v4のリソースにあわせて`quarterly`のみに統一します。 + * 現在`quarter`を参照されている場合、**2025年4月30日までに`quarterly`に変更をお願いいたします**。 + * この変更に伴うご質問・お問い合わせは、[こちら](https://www.buffett-code.com/contacts)からお受けしております。 + */ + post: operations['post-api-v4-metadata-download-link']; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; +} +export type webhooks = Record; +export interface components { + schemas: { + request_body: { + /** + * Format: date-time + * @description この日時以降に公開された資料を探します。形式はRFC3339です。 + * + * @example 2023-10-10T13:50:40+09:00 + */ + published_before?: string; + /** + * Format: date-time + * @description この日時以前に公開された資料を探します。形式はRFC3339です。 + * + * @example 2020-10-10T13:50:40+09:00 + */ + published_after?: string; + /** + * @description 検索したい銘柄コード(ティッカーシンボル)の配列です。銘柄コードは文字列です。 + * + * @example [ + * "1234", + * "2345" + * ] + */ + tickers?: string[]; + /** + * @description 検索したい法人番号の配列です。法人番号は文字列です。 + * + * @example [ + * "1234567890123", + * "2234567890123" + * ] + */ + company_numbers?: string[]; + /** + * @description 指定された文字列のすべてが発行元の法人名に含まれる資料を探します。 + * 2文字以上を指定する必要があります。 + * + * @example [ + * "法人名1", + * "法人名2" + * ] + */ + company_names?: string[]; + /** + * @description 指定された文字列のすべてがタイトルに含まれる資料を探します。 + * 2文字以上を指定する必要があります。 + * + * @example [ + * "タイトル1", + * "タイトル2" + * ] + */ + titles?: string[]; + /** + * @description 指定された文字列のすべてがタイトルに含まれていない資料を探します。 + * 2文字以上を指定する必要があります。 + * + * @example [ + * "タイトル3", + * "タイトル4" + * ] + */ + exclude_titles?: string[]; + /** + * @description 指定された文字列のすべてが本文にふくまれる資料を探します。 + * 2文字以上を指定する必要があります。 + * + * @example [ + * "コロナウイルス", + * "covid-19" + * ] + */ + keywords?: string[]; + /** + * @description 指定された文字列のすべてが本文にふくまれない資料を探します。 + * 2文字以上を指定する必要があります + * + * @example [ + * "コロナウイルス", + * "covid-19" + * ] + */ + exclude_keywords?: string[]; + /** + * @description 検索したい資料カテゴリIDの配列です。 + * 資料は下記のようなカテゴリに分類されています。 + * + * | ID | name | description | + * |----|----|----| + * | 1 | 有報・四半期報告書 | EDINETに提出された、有価証券報告書、四半期報告書。上場時に提出される、有価証券届出書もここに含まれる。 | + * | 2 | 大量保有・変更報告書 | EDINETに提出された、大量保有報告書、変更報告書。 | + * | 3 | 臨時報告書 | EDINETに提出された、臨時報告書。 | + * | 4 | 決算短信 | TDNETに提出された、決算短信。 | + * | 5 | 業績予想の修正 | TDNETに提出された、業績予想の修正。配当予想の修正もここに含まれる。 | + * | 6 | 適時開示 | TDNETに提出された、適時開示。id=4, 5の資料はすべてここにも含まれる。 | + * | 7 | 決算説明資料 | 各社によって開示された決算説明資料。 | + * | 8 | 統合報告書 | 各社によって開示された統合報告書。 | + * | 9 | 中期経営計画 | 各社によって開示された中期経営計画。 | + * + * @example [ + * 1, + * 2, + * 3 + * ] + */ + categories?: number[]; + /** + * @description 検索結果のオフセット値。 + * + * @default 0 + * @example 10 + */ + offset: number; + /** + * @description 一度に取得する検索結果の数です。 + * + * 1以上、100以下である必要があります。 + * + * @default 20 + * @example 50 + */ + size: number; + /** + * @description 検索結果をソートするフィールド名です。 + * 現在は公開日時 “published_at” のみサポートされています。 + * 指定しない場合、関連度順に並びます。 + * + * @example published_at + * @enum {string} + */ + sort?: 'published_at'; + /** + * @description ソート順です。ascかdescのいずれかを指定してください。 + * sortに “published_at” を指定した場合、ascで日付の昇順で並びます。 + * + * sortが未設定の場合関連度順にならび、orderの設定は無視されます。 + * + * @example desc + * @enum {string} + */ + order?: 'asc' | 'desc'; + }; + attribute: { + /** + * @description 資料のタイトルです。 + * @example 半期報告書-第24期第2四半期(令和2年7月1日-令和2年9月30日) + */ + title: string; + /** + * @description 資料のカテゴリIDの配列です。分類されていない資料は空配列 `[]` となります。 + * + * 資料は下記のようなカテゴリに分類されています。 + * | ID | name | description | + * |----|---------------|-------------| + * | 1 | 有報・四半期報告書 | EDINETに提出された、有価証券報告書、四半期報告書。上場時に提出される、有価証券届出書もここに含まれる。 | + * | 2 | 大量保有・変更報告書 | EDINETに提出された、大量保有報告書、変更報告書。 | + * | 3 | 臨時報告書 | EDINETに提出された、臨時報告書。 | + * | 4 | 決算短信 | TDNETに提出された、決算短信。 | + * | 5 | 業績予想の修正 | TDNETに提出された、業績予想の修正。配当予想の修正もここに含まれる。 | + * | 6 | 適時開示 | TDNETに提出された、適時開示。id=4, 5の資料はすべてここにも含まれる。 | + * | 7 | 決算説明資料 | 各社によって開示された決算説明資料。 | + * | 8 | 統合報告書 | 各社によって開示された統合報告書。 | + * | 9 | 中期経営計画 | 各社によって開示された中期経営計画。 | + * + * @example [ + * 1, + * 2 + * ] + */ + categories: number[]; + /** + * @description 資料の発行元の法人番号です。 + * 法人番号が利用開始される2015/10/05以前に上場廃止、もしくは廃業した一部の会社ではnullが返ります。 + * + * @example 1234567890123 + */ + company_number?: string; + /** + * @description 資料の発行元の銘柄コード(ティッカーシンボル)です。 + * + * @example 1234 + */ + ticker: string; + /** + * @description 資料の発行元の法人名です。 + * 2015/10/05以前に上場廃止、もしくは廃業した一部の会社では、 nullが返ります。 + * + * @example 株式会社サンプル + */ + company_name?: string; + /** + * Format: date-time + * @description 資料が発行された時刻です。 + * 形式はRFC3339です。 + * + * @example 2020-10-10T13:50:40+09:00 + */ + published_at: string; + /** + * @description 資料のタグIDの配列です。どのカテゴリにも当てはまらない資料は空配列 `[]` となります。 + * + * タグは下記のようなカテゴリに分類されています。 + * |ID|name| + * |---|---| + * |1|自社株買い| + * |2|短信| + * |3|有報| + * |4|臨時報告書| + * |5|変更報告書| + * |6|訴訟| + * |7|定款| + * |8|分割・併合| + * |9|月次| + * |10|株主総会| + * |11|臨時株主総会| + * |12|優待| + * |13|配当| + * |14|提携| + * |15|TOB| + * |16|合併| + * |17|第三者報告| + * |18|辞任| + * |19|中期経営計画| + * |20|決算説明資料| + * |21|業績予想の修正| + * |22|配当予想の修正| + * |23|決算| + * |24|株主提案| + * |25|人事異動| + * |26|出資・提携| + * |27|不祥事| + * + * @example [ + * 1, + * 2 + * ] + */ + tags?: number[]; + }; + data: { + /** + * @description ドキュメントのIDです。 + * + * @example e773e79e581d1c3ec1c446a9db95065f + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::DocumentSearchResult" が入ります。 + * + * @example Api::V4::Jp::DocumentSearchResult + */ + type: string; + attributes: components['schemas']['attribute']; + }; + meta: { + /** + * @description 検索結果の総件数です。 + * + * 検索結果が10000件を超える場合は、そこで検索が打ち切られ、totalは常に10000となります。この場合は、必要に応じて検索条件を変更し、再検索してください。 + * + * @example 100 + */ + total: number; + /** + * @description リクエストされたsizeの値です。 + * + * @example 20 + */ + size: number; + /** + * @description リクエストされたoffsetの値です。 + * + * @example 10 + */ + offset: number; + }; + response: { + data: components['schemas']['data'][]; + meta: components['schemas']['meta']; + }; + 'attribute-2': { + /** + * Format: uri + * @description 生成されたダウンロードリンクのURLです。ダウンロードリンクは有効期限があります。 + * + * @example https://example.com/download_link/1c6a5615848b7df6bb4505 + */ + url: string; + /** + * Format: date-time + * @description この時刻までダウンロードリンクが有効です。形式はRFC3339です。 + * + * @example 2023-09-16T06:05:40Z + */ + expires_at: string; + /** + * @description 指定されたドキュメントのIDです。 + * + * @example 1c6a5615848b7df6bb4505 + */ + document_id: string; + }; + 'data-2': { + /** + * @description 生成されたダウンロードリンクのIDです。 + * + * @example e773e79e581d1c3ec1c446a9db95065f + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::DocumentDownloadLink" が入ります。 + * + * @example Api::V4::Jp::DocumentDownloadLink + */ + type: string; + attributes: components['schemas']['attribute-2']; + }; + 'response-2': { + data: components['schemas']['data-2']; + }; + attributes: { + /** + * @description 法人番号です。 + * @example 9011001065997 + */ + company_number: string; + /** + * Format: uri + * @description コーポレートサイトのURLです。 + * @example https://corporate.kakaku.com/ + */ + url?: string; + /** + * @description 企業名です。 + * @example 株式会社カカクコム + */ + name: string; + /** + * @description 英語表記での企業名です。 + * @example null + */ + name_en?: string; + /** + * Format: date + * @description 設立日です。設立した月が不明な場合は1月、日が不明の場合は1日が使用されます。 + * @example 1997-12-01 + */ + established_date?: string; + /** + * Format: uri + * @description バフェット・コードのサイト内の企業ページのURLです。 + * @example https://www.buffett-code.com/company/2371 + */ + buffett_code_url?: string; + /** + * @description 銘柄コードです。未上場企業は `null` です。 + * @example 2371 + */ + ticker?: string; + /** + * Format: date + * @description 株式の上場日です。上場した月が不明な場合は1月、日が不明の場合は1日が使用されます。未上場企業は `null` です。 + * @example 2003-10-09 + */ + listing_date?: string; + /** + * @description 東証33業種の業種コードです。未上場企業は `null` です。 + * * `0050` - 水産・農林業 + * * `1050` - 鉱業 + * * `2050` - 建設業 + * * `3050` - 食料品 + * * `3100` - 繊維製品 + * * `3150` - パルプ・紙 + * * `3200` - 化学 + * * `3250` - 医薬品 + * * `3300` - 石油・石炭製品 + * * `3350` - ゴム製品 + * * `3400` - ガラス・土石製品 + * * `3450` - 鉄鋼 + * * `3500` - 非鉄金属 + * * `3550` - 金属製品 + * * `3600` - 機械 + * * `3650` - 電気機器 + * * `3700` - 輸送用機器 + * * `3750` - 精密機器 + * * `3800` - その他製品 + * * `4050` - 電気・ガス業 + * * `5050` - 陸運業 + * * `5100` - 海運業 + * * `5150` - 空運業 + * * `5200` - 倉庫・運輸関連業 + * * `5250` - 情報・通信業 + * * `6050` - 卸売業 + * * `6100` - 小売業 + * * `7050` - 銀行業 + * * `7100` - 証券、商品先物取引 + * * `7150` - 保険業 + * * `7200` - その他金融業 + * * `8050` - 不動産業 + * * `9050` - サービス業 + * + * @example 9050 + * @enum {string} + */ + tosho_33category?: + | '0050' + | '1050' + | '2050' + | '3050' + | '3100' + | '3150' + | '3200' + | '3250' + | '3300' + | '3350' + | '3400' + | '3450' + | '3500' + | '3550' + | '3600' + | '3650' + | '3700' + | '3750' + | '3800' + | '4050' + | '5050' + | '5100' + | '5150' + | '5200' + | '5250' + | '6050' + | '6100' + | '7050' + | '7100' + | '7150' + | '7200' + | '8050' + | '9050'; + /** + * @description `tosho_33category`の日本語ラベルです。未上場企業は `null` です。 + * + * @example サービス業 + */ + tosho_33category_ja?: string; + /** + * @description 優先市場です。現在のところ、名証は新規市場区分に非対応となっています。未上場企業は `null` です。 + * * `tp` - 東証プライム + * * `ts` - 東証スタンダード + * * `tg` - 東証グロース + * * `s` - 札証 + * * `sa` - 札証アンビシャス + * * `m1` - 名証1部 + * * `m2` - 名証2部 + * * `ms` - 名証セントレックス + * * `f` - 福証 + * * `fq` - 福証Q + * * `delisting` - 上場廃止 + * + * @example tp + * @enum {string} + */ + primary_market?: + | 'tp' + | 'ts' + | 'tg' + | 's' + | 'sa' + | 'm1' + | 'm2' + | 'ms' + | 'f' + | 'fq' + | 'delisting'; + /** + * @description 決算月です。最新の直近本決算の決算月が使用されます。 + * @example 12 + */ + fiscal_month?: number; + /** + * @description 事業概要の要約です。 + * @example 当社は、ユーザー本位の価値あるサービスを創出し続ける生活者視点の新しい価値を提供して、日々の生活を豊かにすることを目指しています。主要サービスとしては、価格比較サイト「価格.com」、飲食店情報サイト「食べログ」、求人情報サイト「求人ボックス」などを運営しています。これらのサービスを通じて、ユーザーの生活に役立つ情報を提供し、利便性の向上に努めています。また、関連会社を通じて、保険、映画、旅行などの分野にも事業を展開しています。 + * 当社は、「価格.com」「食べログ」「求人ボックス」などのインターネット・メディア事業と、「価格.com保険」における保険代理店業務から成るファイナンス事業を展開しています。 + * 価格.comは、製品やサービスの価格、スペック、クチコミ、レビューなどの情報を提供し、消費者の購買活動を支援するサービスです。月間総ページビューは3億2,580万PV、月間利用者数は4,029万人に上ります。収益モデルは、ECモールやショップ、金融サービス事業者などへの手数料収入や広告収入です。 + * 食べログは、外食体験を豊かにするレストラン検索・予約サービスです。掲載店舗数は85万店以上、月間総ページビューは20億7,121万PV、月間利用者数は9,500万人に達しています。収益モデルは、飲食店への広告・予約サービス収入や会員収入です。 + * 求人ボックスは、全国の求人情報を一括検索できるサービスです。月間総ページビューは1億196万PV、月間利用者数は759万人です。収益モデルは、求人サイトや採用企業への送客に応じた手数料収入です。 + * このように、当社は消費者の購買活動や外食、求人活動を支援するサービスを展開し、事業を通じて豊かな生活の実現に貢献しています。 + * + */ + summarized_business_description?: string; + }; + 'data-3': { + /** + * @description バフェット・コードが発番している企業IDです。 + * @example fimjod6xcm + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::Company" が入ります。 + * + * @example Api::V4::Jp::Company + */ + type: string; + attributes: components['schemas']['attributes']; + }; + 'response-3': { + data: components['schemas']['data-3']; + }; + 'attributes-2': { + /** + * @description 法人番号です。 + * @example 9011001065997 + */ + company_number: string; + /** + * @description 銘柄コードです。 + * @example 2371 + */ + ticker: string; + /** + * Format: date + * @description 指標が更新された日付です。 + * @example 2020-09-06 + */ + date: string; + /** + * @description 時価総額です。単位は円です。 + * @example 1234 + */ + market_capital?: number; + /** + * @description 企業価値です。単位は円です。 + * @example 1234 + */ + enterprise_value?: number; + /** + * Format: float + * @description EPS(会社予想)です。単位は円です。 + * @example 123.4 + */ + eps_forecast?: number; + /** + * Format: float + * @description PER(会社予想)です。単位は倍です。 + * @example 123.4 + */ + per_forecast?: number; + /** + * Format: float + * @description PBRです。単位は倍です。 + * @example 123.4 + */ + pbr?: number; + /** + * Format: float + * @description PER×PBRです。単位はありません。 + * @example 123.4 + */ + per_pbr?: number; + /** + * @description EBITDA(会社予想)です。単位は円です。 + * @example 1234 + */ + ebitda_forecast?: number; + /** + * Format: float + * @description EV/EBITDA(会社予想)です。単位は倍です。 + * @example 123.4 + */ + ev_ebitda_forecast?: number; + /** + * Format: float + * @description PSR(会社予想)です。単位は倍です。 + * @example 123.4 + */ + psr_forecast?: number; + /** + * Format: float + * @description PCFRです。単位は倍です。 + * @example 123.4 + */ + pcfr_forecast?: number; + /** + * @description 配当金(会社予想)です。単位は円です。 + * @example 1234 + */ + ex_dividend?: number; + /** + * Format: float + * @description 配当利回り(会社予想)です。単位は%です。 + * @example 123.4 + */ + dividend_yield_forecast?: number; + /** + * Format: float + * @description 配当利回り(実績)です。単位は%です。 + * @example 123.4 + */ + dividend_yield_actual?: number; + /** + * Format: float + * @description 売上高成長率(直近年度実績→会社予想)です。単位は%です。 + * @example 123.4 + */ + net_sales_growth_rate_forecast?: number; + /** + * Format: float + * @description 営業利益成長率(直近年度実績→会社予想)です。単位は%です。 + * @example 123.4 + */ + operating_income_growth_rate_forecast?: number; + /** + * Format: float + * @description 純利益成長率(直近年度実績→会社予想)です。単位は%です。 + * @example 123.4 + */ + net_income_growth_rate_forecast?: number; + /** + * Format: float + * @description 有利子負債/時価総額比率です。単位は倍です。 + * @example 123.4 + */ + debt_market_capital_ratio?: number; + /** + * Format: float + * @description キャッシュ時価総額比率です。単位は%です。 + * @example 123.4 + */ + cash_market_capital_ratio?: number; + /** + * @description 売上高(ガイダンス)です。単位は円です。 + * @example 1234 + */ + net_sales_guidance?: number; + /** + * @description 営業利益(ガイダンス)です。単位は円です。 + * @example 1234 + */ + operating_income_guidance?: number; + /** + * @description 親会社株主に帰属する当期純利益(ガイダンス)です。単位は円です。 + * @example 1234 + */ + profit_loss_attributable_to_owners_of_parent_guidance?: number; + /** + * @description 経常利益(ガイダンス)です。単位は円です。 + * @example 1234 + */ + ordinary_income_guidance?: number; + }; + 'data-4': { + /** + * @description リソースの特定に利用されるIDです。 + * @example fimjod6xcm:2020-09-06 + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::Company::Daily" が入ります。 + * + * @example Api::V4::Jp::Company::Daily + */ + type: string; + attributes: components['schemas']['attributes-2']; + }; + 'response-4': { + data: components['schemas']['data-4']; + }; + 'attributes-3': { + /** + * @description 法人番号です。 + * @example 9011001065997 + */ + company_number: string; + /** + * @description 銘柄コードです。 + * @example 2371 + */ + ticker: string; + /** + * Format: date + * @description 指標が更新された日付です。 + * @example 2020-09-06 + */ + date: string; + /** + * Format: float + * @description 株価変動率です。単位は%です。 + * @example 123.4 + */ + stock_price_change_rate?: number; + /** + * @description 市場リアクションのサマリを文章化したものです。 + * @example 第4四半期の売上と営業利益はそれぞれ162億円、60億円で着地した。これは市場コンセンサスに対してそれぞれ101.0%と103.4%であり、市場予想を上回ったことでPTS株価は一時+3.1%を付けた。市場関係者の間の事前予想では①価格.comの減収が下げ止まるか、②食べログの増収は2桁台を維持できるか、③求人ボックスの高成長率は維持されるか、が主な焦点とされていたが、いずれも事前予想と同等か、それを上回った点が好感された + */ + text?: string; + /** + * @description 市場リアクションに関連するドキュメントIDの配列です。 + * @example [ + * "1c6a5615848b7df6bb4505" + * ] + */ + document_ids?: string[]; + }; + 'data-5': { + /** + * @description リソースの特定に利用されるIDです。 + * @example fimjod6xcm:2020-09-06:market-reaction + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::Company::Daily::MarketReaction" が入ります。 + * + * @example Api::V4::Jp::Company::Daily::MarketReaction + */ + type: string; + attributes: components['schemas']['attributes-3']; + }; + 'response-5': { + data: components['schemas']['data-5']; + }; + 'attributes-4': { + /** + * @description 法人番号です。 + * @example 9011001065997 + */ + company_number: string; + /** + * @description 銘柄コードです。 + * @example 2371 + */ + ticker: string; + /** + * @description 指標の計算対象となる年です。 + * @example 2020 + */ + year: number; + /** + * @description 指標の計算対象となる週番号です。 + * @example 9 + */ + week: number; + /** + * Format: date + * @description 指標の計算対象となる期間の開始日です。 + * @example 2020-09-06 + */ + start_date: string; + /** + * Format: date + * @description 指標の計算対象となる期間の終了日です。 + * @example 2021-09-06 + */ + end_date: string; + /** + * Format: float + * @description β(ベータ)です。 + * @example 123.4 + */ + beta?: number; + /** + * Format: float + * @description α(アルファ)です。 + * @example 123.4 + */ + alpha?: number; + /** + * Format: float + * @description βの相関係数です。 + * @example 123.4 + */ + beta_r?: number; + /** + * Format: float + * @description βの決定係数です。 + * @example 123.4 + */ + beta_r_squared?: number; + /** + * @description βの利用データ数です。 + * @example 1234 + */ + beta_count?: number; + }; + 'data-6': { + /** + * @description リソースの特定に利用されるIDです。 + * @example fimjod6xcm:2020W09:stat-1 + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::Company::Weekly::Stat" が入ります。 + * + * @example Api::V4::Jp::Company::Weekly::Stat + */ + type: string; + attributes: components['schemas']['attributes-4']; + }[]; + 'response-6': { + data: components['schemas']['data-6']; + }; + 'attributes-5': { + /** + * @description 法人番号です。 + * @example 9011001065997 + */ + company_number: string; + /** + * @description 銘柄コードです。 + * @example 2371 + */ + ticker: string; + /** + * @description 指標の計算対象となる年です。 + * @example 2020 + */ + year: number; + /** + * @description 指標の計算対象となる月です。 + * @example 9 + */ + month: number; + /** + * Format: date + * @description 指標の計算対象となる期間の開始日です。 + * @example 2020-09-06 + */ + start_date: string; + /** + * Format: date + * @description 指標の計算対象となる期間の終了日です。 + * @example 2021-09-06 + */ + end_date: string; + /** + * Format: float + * @description β(ベータ)です。 + * @example 123.4 + */ + beta?: number; + /** + * Format: float + * @description α(アルファ)です。 + * @example 123.4 + */ + alpha?: number; + /** + * Format: float + * @description βの相関係数です。 + * @example 123.4 + */ + beta_r?: number; + /** + * Format: float + * @description βの決定係数です。 + * @example 123.4 + */ + beta_r_squared?: number; + /** + * @description βの利用データ数です。 + * @example 1234 + */ + beta_count?: number; + }; + 'data-7': { + /** + * @description リソースの特定に利用されるIDです。 + * @example fimjod6xcm:2020-09:stat-1 + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::Company::Monthly::Stat" が入ります。 + * + * @example Api::V4::Jp::Company::Monthly::Stat + */ + type: string; + attributes: components['schemas']['attributes-5']; + }[]; + 'response-7': { + data: components['schemas']['data-7']; + }; + 'attributes-6': { + /** + * @description 法人番号です。 + * @example 9011001065997 + */ + company_number: string; + /** + * @description 銘柄コードです。 + * @example 2371 + */ + ticker: string; + /** + * @description 重要業績評価指標の対象年です。 + * @example 2020 + */ + year: number; + /** + * @description 重要業績評価指標の対象月です。 + * @example 9 + */ + month: number; + /** + * @description 重要業績評価指標の名前です。 + * @example 全店売上(円) + */ + name: string; + /** + * @description 重要業績評価指標の値です。 + * @example 1234 + */ + value: number; + }; + 'data-8': { + /** + * @description リソースの特定に利用されるIDです。 + * @example fimjod6xcm:2020-09:kpi-sales_all_store + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::Company::Monthly::Kpi" が入ります。 + * + * @example Api::V4::Jp::Company::Monthly::Kpi + */ + type: string; + attributes: components['schemas']['attributes-6']; + }[]; + 'response-8': { + data: components['schemas']['data-8']; + }; + 'attributes-7': { + /** + * @description 法人番号です。 + * @example 9011001065997 + */ + company_number: string; + /** + * @description ティッカーです。 + * @example 2371 + */ + ticker?: string; + /** + * @description 社名です。 + * @example カカクコム + */ + company_name?: string; + /** + * @description 代表者名です。 + * @example 畑彰之介 + */ + ceo_name?: string; + /** + * @description 所在地です。 + * @example 東京都渋谷区恵比寿南3丁目5番7号 + */ + headquarters_address?: string; + /** + * Format: date + * @description 期末日です。単位は日付です。 + * @example 2020-09-06 + */ + end_date: string; + /** + * Format: date + * @description この決算四半期に対応する、最新の開示が行われた日付です。 + * @example 2020-09-06 + */ + updated_date?: string; + /** + * Format: date-time + * @description この決算四半期に対応する、最初の開示が行われた日時です。多くの場合、証券取引所での決算短信の開示時刻です。 + * @example 2020-09-06T00:00:00+09:00 + */ + first_published_at?: string; + /** + * @description 会計基準です。 + * * `JAPAN_GAAP` - 日本会計基準 + * * `US_GAAP` - 米国会計基準 + * * `IFRS` - 国際会計基準 + * + * @example IFRS + * @enum {string} + */ + accounting_standard?: 'JAPAN_GAAP' | 'US_GAAP' | 'IFRS'; + /** + * @description 決算短信で開示された、未調整の株式総数です。単位は株です。 + * @example 1234 + */ + num_of_shares?: number; + /** + * @description 調整済み発行済株式総数です。自己株数は含みません。単位は株です。 + * @example 1234 + */ + issued_share_num?: number; + /** + * @description 自己株数です。単位は株です。 + * @example 1234 + */ + treasury_stock_num?: number; + /** + * @description 総資産です。単位は円です。 + * @example 1234 + */ + assets?: number; + /** + * @description 流動資産です。単位は円です。 + * @example 1234 + */ + current_assets?: number; + /** + * @description 現預金です。単位は円です。 + * @example 1234 + */ + cash_and_deposits?: number; + /** + * @description 売上債権です。単位は円です。 + * @example 1234 + */ + trade_receivables?: number; + /** + * @description 受取手形および売掛金です。単位は円です。 + * @example 1234 + */ + notes_accounts_receivable?: number; + /** + * @description 受取手形です。単位は円です。 + * @example 1234 + */ + notes_receivable?: number; + /** + * @description 売掛金です。単位は円です。 + * @example 1234 + */ + accounts_receivable?: number; + /** + * @description 有価証券です。単位は円です。 + * @example 1234 + */ + current_securities?: number; + /** + * @description 棚卸資産です。単位は円です。 + * @example 1234 + */ + inventories?: number; + /** + * @description 商品です。単位は円です。 + * @example 1234 + */ + merchandise?: number; + /** + * @description 仕掛品です。単位は円です。 + * @example 1234 + */ + work_in_process?: number; + /** + * @description 原材料です。単位は円です。 + * @example 1234 + */ + raw_materials_and_supplies?: number; + /** + * @description 前払金です。単位は円です。 + * @example 1234 + */ + prepaid_expenses?: number; + /** + * @description 繰延税金資産(流動)です。単位は円です。 + * @example 1234 + */ + current_dta?: number; + /** + * @description 貸倒引当金です。単位は円です。 + * @example 1234 + */ + current_allowance_doubtful_accounts?: number; + /** + * @description 固定資産です。単位は円です。 + * @example 1234 + */ + non_current_assets?: number; + /** + * @description 有形固定資産です。単位は円です。 + * @example 1234 + */ + tangible_fixed_assets?: number; + /** + * @description 建物・構築物です。単位は円です。 + * @example 1234 + */ + buildings?: number; + /** + * @description 機械・運搬具・工具です。単位は円です。 + * @example 1234 + */ + machineries?: number; + /** + * @description 土地です。単位は円です。 + * @example 1234 + */ + land?: number; + /** + * @description 建設仮勘定です。単位は円です。 + * @example 1234 + */ + construction_in_progress?: number; + /** + * @description 無形固定資産です。単位は円です。 + * @example 1234 + */ + intangible_assets?: number; + /** + * @description のれんです。単位は円です。 + * @example 1234 + */ + good_will?: number; + /** + * @description 無形資産(のれん含む)です。単位は円です。 + * @example 1234 + */ + goodwill_and_intangible_assets?: number; + /** + * @description 投資その他の資産です。単位は円です。 + * @example 1234 + */ + investments_and_other_assets?: number; + /** + * @description 投資有価証券です。単位は円です。 + * @example 1234 + */ + investment_securities?: number; + /** + * @description 繰延税金資産(固定)です。単位は円です。 + * @example 1234 + */ + non_current_dta?: number; + /** + * @description 貸倒引当金です。単位は円です。 + * @example 1234 + */ + non_current_allowance_doubtful_accounts?: number; + /** + * @description 敷金および保証金です。単位は円です。 + * @example 1234 + */ + lease_and_guarantee_deposits?: number; + /** + * @description 負債です。単位は円です。 + * @example 1234 + */ + liabilities?: number; + /** + * @description 有利子負債です。単位は円です。 + * @example 1234 + */ + debt?: number; + /** + * @description 流動負債です。単位は円です。 + * @example 1234 + */ + current_liabilities?: number; + /** + * @description 仕入債務です。単位は円です。 + * @example 1234 + */ + trade_payables?: number; + /** + * @description 支払手形および買掛金です。単位は円です。 + * @example 1234 + */ + notes_accounts_payable?: number; + /** + * @description 買掛金です。単位は円です。 + * @example 1234 + */ + accounts_payable?: number; + /** + * @description 支払手形です。単位は円です。 + * @example 1234 + */ + notes_payable?: number; + /** + * @description 短期社債です。単位は円です。 + * @example 1234 + */ + short_term_bonds_payable?: number; + /** + * @description 短期借入金です。単位は円です。 + * @example 1234 + */ + short_term_loans_payable?: number; + /** + * @description コマーシャルペーパーです。単位は円です。 + * @example 1234 + */ + commercial_papers_liabilities?: number; + /** + * @description リース債務(流動負債)です。単位は円です。 + * @example 1234 + */ + current_lease_obligations?: number; + /** + * @description 1年以内返済の長期借入金です。単位は円です。 + * @example 1234 + */ + current_portion_of_long_term_loans?: number; + /** + * @description 1年以内返済の社債です。単位は円です。 + * @example 1234 + */ + current_portion_of_bonds?: number; + /** + * @description 1年以内返済の転換社債です。単位は円です。 + * @example 1234 + */ + current_portion_of_convertible_bonds?: number; + /** + * @description 1年以内返済の新株予約権付社債です。単位は円です。 + * @example 1234 + */ + current_portion_of_bonds_with_subscription_rights?: number; + /** + * @description 前受金です。単位は円です。 + * @example 1234 + */ + advances_received?: number; + /** + * @description 未払法人税等です。単位は円です。 + * @example 1234 + */ + corporate_tax_payable?: number; + /** + * @description 固定負債です。単位は円です。 + * @example 1234 + */ + non_current_liabilities?: number; + /** + * @description 社債です。単位は円です。 + * @example 1234 + */ + bonds_payable?: number; + /** + * @description 転換社債です。単位は円です。 + * @example 1234 + */ + convertible_bonds?: number; + /** + * @description 新株予約権付転換社債です。単位は円です。 + * @example 1234 + */ + convertible_bond_type_bonds_with_subscription_rights?: number; + /** + * @description 新株予約権付社債です。単位は円です。 + * @example 1234 + */ + non_current_bonds_with_subscription_right?: number; + /** + * @description 長期借入金です。単位は円です。 + * @example 1234 + */ + long_term_loans_payable?: number; + /** + * @description リース債務(固定負債)です。単位は円です。 + * @example 1234 + */ + non_current_lease_obligations?: number; + /** + * @description 繰延税金負債(固定)です。単位は円です。 + * @example 1234 + */ + non_current_dtl?: number; + /** + * @description 純資産です。単位は円です。 + * @example 1234 + */ + net_assets?: number; + /** + * @description 株主資本です。単位は円です。 + * @example 1234 + */ + shareholders_equity?: number; + /** + * @description 資本金です。単位は円です。 + * @example 1234 + */ + capital_stock?: number; + /** + * @description 資本剰余金です。単位は円です。 + * @example 1234 + */ + additional_capital_stock?: number; + /** + * @description 利益剰余金です。単位は円です。 + * @example 1234 + */ + retained_earnings?: number; + /** + * @description 自己株式です。単位は円です。 + * @example 1234 + */ + treasury_stock?: number; + /** + * @description 評価換算差額等です。単位は円です。 + * @example 1234 + */ + valuation_and_translation_adjustments?: number; + /** + * @description 非支配持分です。単位は円です。 + * @example 1234 + */ + non_controlling_interests?: number; + /** + * @description 売上です。単位は円です。 + * @example 1234 + */ + net_sales?: number; + /** + * @description 売上原価です。単位は円です。 + * @example 1234 + */ + cost_of_sales?: number; + /** + * @description 売上総利益です。単位は円です。 + * @example 1234 + */ + gross_profit?: number; + /** + * Format: float + * @description 売上総利益率です。単位は%です。 + * @example 123.4 + */ + gross_margin?: number; + /** + * @description 販売費および一般管理費です。単位は円です。 + * @example 1234 + */ + sga?: number; + /** + * @description 営業利益です。単位は円です。 + * @example 1234 + */ + operating_income?: number; + /** + * Format: float + * @description 営業利益率です。単位は%です。 + * @example 123.4 + */ + operating_margin?: number; + /** + * @description 営業外収益です。単位は円です。 + * @example 1234 + */ + non_operating_income?: number; + /** + * @description 受取利息および受取配当金です。単位は円です。 + * @example 1234 + */ + interest_and_dividends_income?: number; + /** + * @description 受取利息です。単位は円です。 + * @example 1234 + */ + interest_income?: number; + /** + * @description 受取配当金です。単位は円です。 + * @example 1234 + */ + dividends_income?: number; + /** + * @description 持分法による投資利益です。単位は円です。 + * @example 1234 + */ + equity_method_income?: number; + /** + * @description 営業外費用です。単位は円です。 + * @example 1234 + */ + non_operating_expenses?: number; + /** + * @description 支払利息です。単位は円です。 + * @example 1234 + */ + interest_expense?: number; + /** + * @description 持分法による投資損失です。単位は円です。 + * @example 1234 + */ + equity_method_loss?: number; + /** + * @description 経常利益です。単位は円です。 + * @example 1234 + */ + ordinary_income?: number; + /** + * @description 特別利益です。単位は円です。 + * @example 1234 + */ + extraordinary_income?: number; + /** + * @description 固定資産売却益です。単位は円です。 + * @example 1234 + */ + gain_of_sales_non_current_assets?: number; + /** + * @description 投資有価証券売却益です。単位は円です。 + * @example 1234 + */ + gain_of_sales_investment_securities?: number; + /** + * @description 特別損失です。単位は円です。 + * @example 1234 + */ + extraordinary_loss?: number; + /** + * @description 固定資産売却損です。単位は円です。 + * @example 1234 + */ + loss_of_sales_non_current_assets?: number; + /** + * @description 投資有価証券売却損です。単位は円です。 + * @example 1234 + */ + loss_of_valuation_investment_securities?: number; + /** + * @description 減損損失です。単位は円です。 + * @example 1234 + */ + impairment_loss?: number; + /** + * @description 税引前当期純利益です。単位は円です。 + * @example 1234 + */ + income_before_income_taxes?: number; + /** + * @description 法人税等です。単位は円です。 + * @example 1234 + */ + income_taxes?: number; + /** + * Format: float + * @description 実質法人税率です。単位は%です。 + * @example 123.4 + */ + real_corporate_tax_rate?: number; + /** + * @description 非支配持分控除前四半期純利益です。単位は円です。 + * @example 1234 + */ + net_income?: number; + /** + * @description 非支配株主に帰属する当期純利益です。単位は円です。 + * @example 1234 + */ + profit_loss_attributable_to_non_controlling_interests?: number; + /** + * @description 親会社株主に帰属する当期純利益です。単位は円です。 + * @example 1234 + */ + profit_loss_attributable_to_owners_of_parent?: number; + /** + * Format: float + * @description 当期純利益率です。単位は%です。 + * @example 123.4 + */ + net_profit_margin?: number; + /** + * @description 営業キャッシュフローです。単位は円です。 + * @example 1234 + */ + operating_cash_flow?: number; + /** + * @description 税金等調整前当期純利益です。単位は円です。 + * @example 1234 + */ + income_before_taxes?: number; + /** + * @description 減価償却費およびのれん償却費です。単位は円です。 + * @example 1234 + */ + depreciation_and_amortization_op_cf?: number; + /** + * @description 減価償却費です。単位は円です。 + * @example 1234 + */ + depreciation_op_cf?: number; + /** + * @description のれん償却費です。単位は円です。 + * @example 1234 + */ + amortization_op_cf?: number; + /** + * @description 売上債権の増減額です。単位は円です。 + * @example 1234 + */ + decrease_trade_receivables_op_cf?: number; + /** + * @description 棚卸資産の増減額です。単位は円です。 + * @example 1234 + */ + decrease_inventories_op_cf?: number; + /** + * @description 仕入債務の増減額です。単位は円です。 + * @example 1234 + */ + increase_trade_payables_op_cf?: number; + /** + * @description 投資キャッシュフローです。単位は円です。 + * @example 1234 + */ + investment_cash_flow?: number; + /** + * @description 有形固定資産の取得による支出です。単位は円です。 + * @example 1234 + */ + purchase_of_property?: number; + /** + * @description 有形固定資産の売却による収入です。単位は円です。 + * @example 1234 + */ + sale_of_property?: number; + /** + * @description 無形固定資産の取得による支出です。単位は円です。 + * @example 1234 + */ + purchase_of_intangible_assets?: number; + /** + * @description 無形固定資産の売却による収入です。単位は円です。 + * @example 1234 + */ + sale_of_intangible_assets?: number; + /** + * @description 固定資産の取得による支出です。単位は円です。 + * @example 1234 + */ + purchase_of_non_current_assets?: number; + /** + * @description 固定資産の売却による収入です。単位は円です。 + * @example 1234 + */ + sale_of_non_current_assets?: number; + /** + * @description 有価証券の取得による支出です。単位は円です。 + * @example 1234 + */ + purchase_of_securities?: number; + /** + * @description 有価証券の売却・償還による収入です。単位は円です。 + * @example 1234 + */ + sale_of_securities?: number; + /** + * @description 投資有価証券の取得による支出です。単位は円です。 + * @example 1234 + */ + purchase_of_investment_securities?: number; + /** + * @description 投資有価証券の売却・償還による収入です。単位は円です。 + * @example 1234 + */ + sale_of_investment_securities?: number; + /** + * @description 貸付けによる支出です。単位は円です。 + * @example 1234 + */ + lending?: number; + /** + * @description 貸付金の回収による収入です。単位は円です。 + * @example 1234 + */ + return_of_lending?: number; + /** + * @description 財務キャッシュフローです。単位は円です。 + * @example 1234 + */ + financial_cash_flow?: number; + /** + * @description 短期借入金の純増減額です。単位は円です。 + * @example 1234 + */ + net_short_term_debt?: number; + /** + * @description 長期借入れによる収入です。単位は円です。 + * @example 1234 + */ + long_term_debt_issuance?: number; + /** + * @description 長期借入金の返済による支出です。単位は円です。 + * @example 1234 + */ + long_term_debt_repayment?: number; + /** + * @description 社債の発行による収入です。単位は円です。 + * @example 1234 + */ + bonds_issuance?: number; + /** + * @description 社債の償還による支出です。単位は円です。 + * @example 1234 + */ + bonds_repayment?: number; + /** + * @description 自己株式の取得による支出です。単位は円です。 + * @example 1234 + */ + share_repurchase?: number; + /** + * @description 自己株式の売却による収入です。単位は円です。 + * @example 1234 + */ + share_sales?: number; + /** + * @description 配当金の支払額です。単位は円です。 + * @example 1234 + */ + dividend_payment?: number; + /** + * @description 現金及び現金同等物に係る換算差額です。単位は円です。 + * @example 1234 + */ + cash_translation_difference?: number; + /** + * @description フリーキャッシュフローです。単位は円です。 + * @example 1234 + */ + free_cash_flow?: number; + /** + * @description 売上(会社予想)です。単位は円です。 + * @example 1234 + */ + ex_net_sales?: number; + /** + * @description 営業利益(会社予想)です。単位は円です。 + * @example 1234 + */ + ex_operating_income?: number; + /** + * @description 経常利益(会社予想)です。単位は円です。 + * @example 1234 + */ + ex_ordinary_income?: number; + /** + * @description 当期純利益(会社予想)です。単位は円です。 + * @example 1234 + */ + ex_net_income?: number; + /** + * @description 売上(四半期初における会社予想)です。単位は円です。 + * @example 1234 + */ + first_ex_net_sales?: number; + /** + * @description 営業利益(四半期初における会社予想)です。単位は円です。 + * @example 1234 + */ + first_ex_operating_income?: number; + /** + * @description 経常利益(四半期初における会社予想)です。単位は円です。 + * @example 1234 + */ + first_ex_ordinary_income?: number; + /** + * @description 当期純利益(四半期初における会社予想)です。単位は円です。 + * @example 1234 + */ + first_ex_net_income?: number; + /** + * @description 金融収益です。単位は円です。 + * @example 1234 + */ + finance_income?: number; + /** + * @description 金融費用です。単位は円です。 + * @example 1234 + */ + finance_costs?: number; + /** + * @description 配当金(実績)です。単位は円です。 + * @example 1234 + */ + dividend?: number; + /** + * Format: float + * @description EPS(実績)です。単位は円です。 + * @example 123.4 + */ + eps_actual?: number; + /** + * @description BPSです。単位は円です。 + * @example 1234 + */ + bps?: number; + /** + * @description EBITDA(実績)です。単位は円です。 + * @example 1234 + */ + ebitda_actual?: number; + /** + * Format: float + * @description ROEです。単位は%です。 + * @example 123.4 + */ + roe?: number; + /** + * Format: float + * @description 実質ROEです。単位は%です。 + * @example 123.4 + */ + real_roe?: number; + /** + * Format: float + * @description 総資産回転率です。単位は倍です。 + * @example 123.4 + */ + total_asset_turnover?: number; + /** + * Format: float + * @description 財務レバレッジです。単位は倍です。 + * @example 123.4 + */ + financial_leverage?: number; + /** + * Format: float + * @description ROAです。単位は%です。 + * @example 123.4 + */ + roa?: number; + /** + * Format: float + * @description ROICです。単位は%です。 + * @example 123.4 + */ + roic?: number; + /** + * Format: float + * @description 自己資本配当率です。単位は%です。 + * @example 123.4 + */ + doe?: number; + /** + * Format: float + * @description 営業キャッシュフロー/売上比率です。単位は%です。 + * @example 123.4 + */ + net_sales_operating_cash_flow_ratio?: number; + /** + * Format: float + * @description 販管費/売上率です。単位は%です。 + * @example 123.4 + */ + sga_ratio?: number; + /** + * Format: float + * @description 減価償却費/粗利比率です。単位は%です。 + * @example 123.4 + */ + depreciation_gross_profit_ratio?: number; + /** + * Format: float + * @description 研究開発費/売上比率です。単位は%です。 + * @example 123.4 + */ + r_and_d_ratio?: number; + /** + * Format: float + * @description 支払利息/営業利益比率です。単位は%です。 + * @example 123.4 + */ + interest_op_income_ratio?: number; + /** + * Format: float + * @description インタレストカバレッジレシオです。単位は倍です。 + * @example 123.4 + */ + interest_coverage_ratio?: number; + /** + * Format: float + * @description 売上進捗率です。単位は%です。 + * @example 123.4 + */ + net_sales_progress?: number; + /** + * Format: float + * @description 営業利益進捗率です。単位は%です。 + * @example 123.4 + */ + operating_income_progress?: number; + /** + * Format: float + * @description 純利益進捗率です。単位は%です。 + * @example 123.4 + */ + net_income_progress?: number; + /** + * Format: float + * @description 現金総資産比率です。単位は%です。 + * @example 123.4 + */ + cash_assets_ratio?: number; + /** + * Format: float + * @description 現金売上倍率です。単位は倍です。 + * @example 123.4 + */ + cash_monthly_sales_ratio?: number; + /** + * Format: float + * @description 売上債権回転期間です。単位は日です。 + * @example 123.4 + */ + accounts_receivable_turnover?: number; + /** + * Format: float + * @description 棚卸資産回転期間です。単位は日です。 + * @example 123.4 + */ + inventory_turnover?: number; + /** + * Format: float + * @description 仕入債務回転期間です。単位は日です。 + * @example 123.4 + */ + trade_payable_turnover?: number; + /** + * @description 運転資本です。単位は円です。 + * @example 1234 + */ + working_capital?: number; + /** + * Format: float + * @description CCCです。単位は日です。 + * @example 123.4 + */ + ccc?: number; + /** + * Format: float + * @description 有形固定資産回転率です。単位は%です。 + * @example 123.4 + */ + tangible_fixed_assets_turnover?: number; + /** + * Format: float + * @description 有利子負債/総資産比率です。単位は%です。 + * @example 123.4 + */ + debt_assets_ratio?: number; + /** + * Format: float + * @description 有利子負債/月商比率です。単位はヶ月です。 + * @example 123.4 + */ + debt_monthly_sales_ratio?: number; + /** + * Format: float + * @description 有利子負債/営業キャッシュフロー倍率です。単位は倍です。 + * @example 123.4 + */ + operating_cash_flow_debt_ratio?: number; + /** + * @description 純有利子負債です。単位は円です。 + * @example 1234 + */ + net_debt?: number; + /** + * Format: float + * @description 自己株式調整済負債比率です。単位は%です。 + * @example 123.4 + */ + adjusted_debt_ratio?: number; + /** + * Format: float + * @description DE比率です。単位は%です。 + * @example 123.4 + */ + de_ratio?: number; + /** + * Format: float + * @description 流動比率です。単位は%です。 + * @example 123.4 + */ + current_ratio?: number; + /** + * Format: float + * @description ネットD純利益比率です。単位は倍です。 + * @example 123.4 + */ + net_debt_net_income_ratio?: number; + /** + * @description 自己資本です。単位は円です。 + * @example 1234 + */ + equity?: number; + /** + * Format: float + * @description 自己資本比率です。単位は%です。 + * @example 123.4 + */ + equity_ratio?: number; + /** + * @description アクルーアルです。単位は円です。 + * @example 1234 + */ + accrual?: number; + /** + * @description 従業員数です。単位は人です。 + * @example 1234 + */ + employee_num?: number; + /** + * @description 従業員一人あたり売上です。単位は円です。 + * @example 1234 + */ + net_sales_per_employee?: number; + /** + * @description 従業員一人あたり営業利益です。単位は円です。 + * @example 1234 + */ + operating_income_per_employee?: number; + /** + * @description 設備投資額です。単位は円です。 + * @example 1234 + */ + increase_in_properties?: number; + /** + * @description 研究開発費です。単位は円です。 + * @example 1234 + */ + r_and_d_expenses?: number; + /** + * @description 退職給付に係る資産です。 + * @example 1234 + */ + defined_benefit_asset?: number; + /** + * @description 退職給付に係る負債です。 + * @example 1234 + */ + defined_benefit_liability?: number; + /** + * @description 資産除去債務です。 + * @example 1234 + */ + asset_retirement_obligations_ncl?: number; + /** + * @description 新株予約権です。 + * @example 1234 + */ + subscription_rights?: number; + /** + * @description 会計年度です。 + * @example 2020 + */ + fiscal_year: number; + /** + * @description 四半期です。 + * @example 4 + */ + fiscal_quarter: number; + /** + * Format: float + * @description 配当性向です。単位は%です。 + * @example 123.4 + */ + dividend_payout_ratio?: number; + /** + * @description 子会社取得支出です。単位は円です。 + * @example 1234 + */ + payments_for_acquisition_of_subsidiaries?: number; + /** + * @description 子会社取得の収入です。単位は円です。 + * @example 1234 + */ + proceeds_from_purchase_of_subsidiaries?: number; + /** + * @description 子会社売却の支払いです。単位は円です。 + * @example 1234 + */ + payments_for_sales_of_subsidiaries?: number; + /** + * @description 子会社売却の収入です。単位は円です。 + * @example 1234 + */ + proceeds_from_sale_of_subsidiary?: number; + /** + * @description 現金及び現金同等物です。単位は円です。 + * @example 1234 + */ + cash_and_cash_equivalents?: number; + /** + * @description 顧客関係です。単位は円です。 + * @example 1234 + */ + customer_relationship?: number; + /** + * @description 商標権です。単位は円です。 + * @example 1234 + */ + right_of_trademark?: number; + /** + * @description 為替差損です。単位は円です。 + * @example 1234 + */ + foreign_exchange_losses?: number; + /** + * @description 長期借入金の純増減額です。単位は円です。 + * @example 1234 + */ + net_long_term_debt?: number; + /** + * @description 有利子負債(流動負債)です。単位は円です。 + * @example 1234 + */ + short_term_debt?: number; + /** + * @description 有利子負債(固定負債)です。単位は円です。 + * @example 1234 + */ + long_term_debt?: number; + /** + * @deprecated + * @description 減価償却費およびのれん償却費です。単位は円です。こちらは非推奨です。depreciation_and_amortization_op_cfを使用してください。 + * @example 1234 + */ + depreciation?: number; + /** + * @deprecated + * @description のれん償却費です。単位は円です。こちらは非推奨です。amortization_op_cfを使用してください。 + * @example 1234 + */ + amortization?: number; + }; + 'data-9': { + /** + * @description リソースの特定に利用されるIDです。 + * @example fimjod6xcm:2020Q4 + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::Company::Quarterly" が入ります。 + * + * @example Api::V4::Jp::Company::Quarterly + */ + type: string; + attributes: components['schemas']['attributes-7']; + }; + 'response-9': { + data: components['schemas']['data-9']; + }; + 'attributes-8': { + /** + * @description 指定された会社の法人番号です。 + * @example 9011001065997 + */ + company_number: string; + /** + * @description 関連会社の法人番号です。 + * @example 1322001065992 + */ + affiliated_company_number?: string; + /** + * @description 関連会社の名前です。 + * @example カカクコム + */ + affiliated_company_name: string; + /** + * @description 関連会社の住所です。 + * @example 東京都千代田区丸の内1-9-1 + */ + address: string; + /** + * @description 関連会社の事業内容です。 + * @example 不動産事業 + */ + desc_business?: string | null; + /** + * @description 有価証券報告書に記載されている関連会社との関係です。 + * @example 役員の兼任3名経営指導 + */ + relationship?: string | null; + /** + * Format: float + * @description 所有権比率です。 単位は%です。 + * @example 65.5 + */ + voting_rights_ownership_ratio?: number | null; + /** + * Format: float + * @description 被所有権比率です。単位は%です。 + * @example 65.5 + */ + voting_rights_owned_ratio?: number | null; + /** + * @description 投資資本です。単位は円です。 + * @example 1000000 + */ + invested_capital?: number | null; + /** + * @description 投資資本通貨です。ISO4217で対応されている通貨コードです。 + * @example JPY + */ + invested_capital_currency?: string | null; + }; + 'data-10': { + /** + * @description リソースの特定に利用されるIDです。 + * @example fimjod6xcm:2020Q4:affiliated-company-1 + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::Company::Quarterly::AffiliatedCompany" が入ります。 + * + * @example Api::V4::Jp::Company::Quarterly::AffiliatedCompany + */ + type: string; + attributes: components['schemas']['attributes-8']; + }[]; + 'response-10': { + data: components['schemas']['data-10']; + }; + 'attributes-9': { + /** + * @description 所有会社の法人番号です。 + * @example 9011001065997 + */ + owner_company_number?: string | null; + /** + * @description 所有会社の会社名です。 + * @example カカクコム + */ + owner_company_name?: string | null; + /** + * @description 所有会社の所在地です。 + * @example 東京都千代田区丸の内1-9-1 + */ + address?: string | null; + /** + * @description 有価証券報告書記載の設備の名称です。 + * @example 本社 + */ + office_name?: string; + /** + * @description 設備のセグメント名です。 + * @example 不動産事業 + */ + segment_name?: string; + /** + * @description 有価証券報告書記載の設備の詳細です。 + * @example 不動産事業 + */ + details?: string; + /** + * @description 建物の簿価です。単位は円です。 + * @example 1000000 + */ + building_book_value?: number; + /** + * @description 機械の簿価です。単位は円です。 + * @example 1000000 + */ + machinery_book_value?: number; + /** + * @description 使用権資産の簿価です。単位は円です。 + * @example 1000000 + */ + right_of_user_asset_book_value?: number; + /** + * @description リース資産の簿価です。単位は円です。 + * @example 1000000 + */ + lease_asset_book_value?: number; + /** + * @description ソフトウェアの簿価です。単位は円です。 + * @example 1000000 + */ + software_book_value?: number; + /** + * @description その他の簿価です。単位は円です。 + * @example 1000000 + */ + others_book_value?: number; + /** + * @description 総簿価です。単位は円です。 + * @example 1000000 + */ + total_book_value?: number; + /** + * @description 従業員数です。単位は人です。 + * @example 100 + */ + employees?: number; + /** + * @description 土地の簿価です。単位は円です。 + * @example 1000000 + */ + land_book_value?: number; + }; + 'data-11': { + /** + * @description リソースの特定に利用されるIDです。 + * @example fimjod6xcm:2020Q4:major-facility-1 + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::Company::Quarterly::MajorFacility" が入ります。 + * + * @example Api::V4::Jp::Company::Quarterly::MajorFacility + */ + type: string; + attributes: components['schemas']['attributes-9']; + }[]; + 'response-11': { + data: components['schemas']['data-11']; + }; + 'attributes-10': { + /** + * @description 法人番号です。 + * @example 9011001065997 + */ + company_number: string; + /** + * @description バフェット・コードが発番している企業IDです。 + * @example fimjod6xcm + */ + company_id: string; + /** + * @description ティッカーです。 + * @example 2371 + */ + ticker?: string; + /** + * @description 会計年度です。 + * @example 2020 + */ + fiscal_year: number; + /** + * @description 四半期です。 + * @example 4 + */ + fiscal_quarter: number; + /** + * @description 有価証券報告書もしくは四半期報告書に、「事業内容」として記載されたHTMLです。 + * @example

3【事業の内容】

事業内容の本文です

+ */ + business_description_html?: string; + /** + * @description 有価証券報告書もしくは四半期報告書に、「沿革」として記載されたHTMLです。 + * @example

3【沿革】

沿革の本文です

+ */ + company_history_html?: string; + /** + * @description 有価証券報告書もしくは四半期報告書に、「セグメント情報」として記載されたHTMLです。 + * @example

3【セグメント情報】

セグメント情報の本文です

+ */ + segment_information_html?: string; + /** + * @description 有価証券報告書もしくは四半期報告書に、「販売費及び一般管理費のうち主要な費目及び金額」として記載されたHTMLです。 + * @example

3【販売費及び一般管理費のうち主要な費目及び金額】

販売費及び一般管理費のうち主要な費目及び金額の本文です

+ */ + major_sga_html?: string; + /** + * @description 有価証券報告書もしくは四半期報告書に、「キャッシュ・フロー計算書」として記載されたHTMLです。 + * @example

3【キャッシュ・フロー計算書】

キャッシュ・フロー計算書の本文です

+ */ + consolidated_cashflow_statement_html?: string; + /** + * @description 有価証券報告書もしくは四半期報告書に、「研究開発活動」として記載されたHTMLです。 + * @example

3【研究開発活動】

研究開発活動の本文です

+ */ + r_and_d_activities_html?: string; + /** + * @description 有価証券報告書もしくは四半期報告書に、「サステナビリティに関する考え方及び取組」として記載されたHTMLです。 + * @example

3【サステナビリティに関する考え方及び取組】

サステナビリティに関する考え方及び取組の本文です

+ */ + disclosure_of_sustainability_html?: string; + /** + * @description 有価証券報告書もしくは四半期報告書に、「経営方針、経営環境及び対処すべき課題等」として記載されたHTMLです。 + * @example

3【経営方針、経営環境及び対処すべき課題等】

経営方針、経営環境及び対処すべき課題等の本文です

+ */ + business_policy_environment_issues_html?: string; + /** + * @description 有価証券報告書もしくは四半期報告書に、「経営者による財政状態、経営成績及びキャッシュ・フローの状況の分析」として記載されたHTMLです。 + * @example

3【経営者による財政状態、経営成績及びキャッシュ・フローの状況の分析】

経営者による財政状態、経営成績及びキャッシュ・フローの状況の分析の本文です

+ */ + overview_of_business_results_html?: string; + }; + 'data-12': { + /** + * @description リソースの特定に利用されるIDです。 + * @example fimjod6xcm:2013Q4:long-text-content + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::Company::Quarterly::LongTextContent" が入ります。 + * + * @example Api::V4::Jp::Company::Quarterly::LongTextContent + */ + type: string; + attributes: components['schemas']['attributes-10']; + }; + 'response-12': { + data: components['schemas']['data-12']; + }; + 'attributes-11': { + /** + * @description 法人番号です。 + * @example 9011001065997 + */ + company_number: string; + /** + * @description ティッカーです。 + * @example 1234 + */ + ticker: string; + /** + * @description バフェット・コードで利用されている企業ID(10桁英数)です。 + * @example abcde12345 + */ + company_id: string; + /** + * @description 決算年度です。 + * @example 2020 + */ + fiscal_year: number; + /** + * @description 決算四半期です。 + * @example 4 + */ + fiscal_quarter: number; + /** + * @description 大株主の順位です。 + * @example 1 + */ + rank: number; + /** + * @description 大株主名です。匿名化されている場合は `null` です。 + * @example 東京太郎 + */ + name?: string; + /** + * @description 大株主の住所です。匿名化されている場合は `null` です。 + * @example 新宿区西新宿2-8-1 + */ + address?: string; + /** + * Format: float + * @description 大株主の保有割合です。 + * @example 0.05 + */ + ratio?: number; + /** + * @description 有価証券報告書もしくは四半期報告書に記載された、分割調整前の保有株数です。 + * @example 100000 + */ + unadjusted_shares?: number; + /** + * @description 分割調整前の保有株数 `unadjusted_shares` を、現在の株式分割比率に合わせて調整した保有株数です。 + * @example 200000 + */ + adjusted_shares?: number; + /** + * @description 評価額です。単位は円です。 + * @example 1000000 + */ + valuation?: number; + /** + * @description 匿名化処理の有無です。 + * @example false + */ + is_anonymized: boolean; + }; + 'data-13': { + /** + * @description リソースの特定に利用されるIDです。 + * @example abcde12345:2020Q4:major-shareholder-1 + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::Company::Quarterly::MajorShareholder" が入ります。 + * + * @example Api::V4::Jp::Company::Quarterly::MajorShareholder + */ + type: string; + attributes: components['schemas']['attributes-11']; + }[]; + 'response-13': { + data: components['schemas']['data-13']; + }; + 'attributes-12': { + /** + * @description 法人番号です。 + * @example 9011001065997 + */ + company_number: string; + /** + * @description ティッカーです。 + * @example 1234 + */ + ticker: string; + /** + * @description バフェット・コードで利用されている企業ID(10桁英数)です。 + * @example abcde12345 + */ + company_id: string; + /** + * @description 決算年度です。 + * @example 2020 + */ + fiscal_year: number; + /** + * @description 決算四半期です。 + * @example 4 + */ + fiscal_quarter: number; + /** + * @description 特定の企業の該当四半期において、セグメントを一意に特定するためのキーです。 + * 同一企業でも、異なる四半期においては異なる意味を持ちます。 + * + * なお、「その他」で計上されたセグメントについては、企業・四半期を問わず、常に `"other"` が設定されます。 + * + * @example energy + */ + key: string; + /** + * @description 売上高です。単位は円です。 + * @example 1000000 + */ + net_sales?: number; + /** + * @description 営業利益です。単位は円です。 + * @example 1000000 + */ + operation_income?: number; + /** + * Format: float + * @description 営業利益率です。単位は%です。 + * @example 0.05 + */ + operating_margin?: number; + /** + * @description 日本語のセグメント名です。一部未翻訳のものも含まれます。 + * @example 開発販売事業 + */ + name_ja?: string; + }; + 'data-14': { + /** + * @description リソースの特定に利用されるIDです。 + * @example abcde12345:2020Q4:segment-energy + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::Company::Quarterly::Segment" が入ります。 + * + * @example Api::V4::Jp::Company::Quarterly::Segment + */ + type: string; + attributes: components['schemas']['attributes-12']; + }[]; + 'response-14': { + data: components['schemas']['data-14']; + }; + 'attributes-13': { + /** + * @description バフェット・コードにおける企業IDです。 + * @example fimjod6xcm + */ + company_id: string; + /** + * @description 法人番号です。 + * @example 9011001065997 + */ + company_number: string; + /** + * @description 銘柄コードです。 + * @example 2371 + */ + ticker: string; + /** + * @description 業績予想の対象となる決算年度です。 + * @example 2020 + */ + fiscal_year: number; + /** + * Format: date + * @description 業績予想の対象となる決算年度の締日です。 + * @example 2020-09-06 + */ + end_date: string; + /** + * @description ドキュメントのIDです。 + * @example 1c6a5615848b7df6bb4505 + */ + document_id?: string; + /** + * Format: date-time + * @description 業績予想の修正が公開された日時です。RFC3339形式です。 + * @example 2020-09-06T13:50:40+09:00 + */ + updated_at: string; + /** + * @description 売上(会社予想)です。単位は円です。 + * @example 1234 + */ + net_sales?: number; + /** + * @description 純利益(会社予想)です。単位は円です。 + * @example 1234 + */ + net_profit?: number; + /** + * @description 営業利益(会社予想)です。単位は円です。 + * @example 1234 + */ + operating_income?: number; + /** + * @description 経常利益(会社予想)です。単位は円です。 + * @example 1234 + */ + ordinary_income?: number; + /** + * @description 配当金(会社予想)です。単位は円です。 + * @example 1234 + */ + dividend?: number; + }; + 'data-15': { + /** + * @description リソースの特定に利用されるIDです。 + * @example fimjod6xcm:FY2020:guidance-revision-1c6a5615848b7df6bb4505 + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::Company::Annually::GuidanceRevision" が入ります。 + * + * @example Api::V4::Jp::Company::Annually::GuidanceRevision + */ + type: string; + attributes: components['schemas']['attributes-13']; + }[]; + 'response-15': { + data: components['schemas']['data-15']; + }; + 'attributes-14': { + /** + * @description バフェット・コードにおける企業IDです。 + * @example fimjod6xcm + */ + company_id: string; + /** + * @description 法人番号です。 + * @example 9011001065997 + */ + company_number: string; + /** + * @description 類似企業のバフェット・コードにおける企業IDです。 + * @example fimjod6xcm + */ + similar_company_id: string; + /** + * @description 類似企業の法人番号です。 + * @example 9011001065997 + */ + similar_company_number: string; + /** + * @description ベータ版フラグです。ベータ版として提供している類似企業の場合、 `true` となります。 + * @example false + */ + is_beta: boolean; + }; + 'data-16': { + /** + * @description リソースの特定に利用されるIDです。 + * @example fimjod6xcm:similarity-fimjod6xcm + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Jp::Company::Similarity" が入ります。 + * + * @example Api::V4::Jp::Company::Similarity + */ + type: string; + attributes: components['schemas']['attributes-14']; + }[]; + 'response-16': { + data: components['schemas']['data-16']; + }; + 'attributes-15': { + /** + * @description CIKコードです。 + * @example 0001652044 + */ + cik: string; + /** + * Format: uri + * @description コーポレートサイトのURLです。 + * @example https://example.com + */ + url?: string; + /** + * @description 企業名です。 + * @example Alphabet Inc. + */ + name?: string; + /** + * Format: date + * @description 設立日です。 + * @example 2020-09-06 + */ + established_date?: string; + /** + * @description 企業日に紐づく銘柄コード一覧です。 + * @example [ + * "GOOG", + * "GOOGL" + * ] + */ + tickers?: string[]; + /** + * Format: uri + * @description バフェット・コードのサイト内の企業ページのURLです。 + * @example https://www.buffett-code.com/company/us/0001652044/ + */ + buffett_code_url?: string; + }; + 'data-17': { + /** + * @description CIKです。 + * @example 0001652044 + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Us::Company" が入ります。 + * + * @example Api::V4::Us::Company + */ + type: string; + attributes: components['schemas']['attributes-15']; + }; + 'response-17': { + data: components['schemas']['data-17']; + }; + 'attributes-16': { + /** + * @description CIKです。 + * @example 0001652044 + */ + cik: string; + /** + * Format: date + * @description 日付です。 + * @example 2020-09-06 + */ + date: string; + /** + * @description 時価総額です。単位はドルです。 + * @example 1234 + */ + market_capital?: number; + /** + * @description 企業価値です。単位はドルです。 + * @example 1234 + */ + enterprise_value?: number; + /** + * Format: float + * @description EV/EBITDA(実績)です。単位は倍です。 + * @example 123.4 + */ + ev_ebitda_actual?: number; + /** + * Format: float + * @description キャッシュ時価総額比率です。単位は%です。 + * @example 123.4 + */ + cash_market_capital_ratio?: number; + /** + * Format: float + * @description PSR(実績)です。単位は倍です。 + * @example 123.4 + */ + psr_actual?: number; + /** + * Format: float + * @description 有利子負債/時価総額比率です。単位は倍です。 + * @example 123.4 + */ + debt_market_capital_ratio?: number; + /** + * Format: float + * @description PER(実績)です。単位は倍です。 + * @example 123.4 + */ + per_actual?: number; + /** + * Format: float + * @description PBRです。単位は倍です。 + * @example 123.4 + */ + pbr?: number; + /** + * Format: float + * @description PER(実績)×PBRです。単位はありません。 + * @example 123.4 + */ + per_actual_pbr?: number; + }; + 'data-18': { + /** + * @description リソースの特定するためのIDです。 + * @example 0001652044:2020-09-06 + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Us::Company::Daily" が入ります。 + * + * @example Api::V4::Us::Company::Daily + */ + type: string; + attributes: components['schemas']['attributes-16']; + }; + 'response-18': { + data: components['schemas']['data-18']; + }; + 'attributes-17': { + /** + * @description CIKです。 + * @example 0001652044 + */ + cik: string; + /** + * @description 決算年です。 + * @example 1234 + */ + fiscal_year: number; + /** + * @description 決算四半期です。 + * @example 1234 + */ + fiscal_quarter: number; + /** + * Format: date + * @description 締日です。 + * @example 2020-09-06 + */ + end_date: string; + /** + * @description 流動資産です。単位はドルです。 + * @example 1234 + */ + current_assets?: number; + /** + * @description 現金及び預金です。単位はドルです。 + * @example 1234 + */ + cash_and_deposits?: number; + /** + * @description 資産です。単位はドルです。 + * @example 1234 + */ + assets?: number; + /** + * @description 流動資産です。単位はドルです。 + * @example 1234 + */ + current_liabilities?: number; + /** + * @description コマーシャルペーパーです。単位はドルです。 + * @example 1234 + */ + commercial_papers_liabilities?: number; + /** + * @description 1年以内返済の長期借入金です。単位はドルです。 + * @example 1234 + */ + current_portion_of_long_term_loans?: number; + /** + * @description 長期借入金です。単位はドルです。 + * @example 1234 + */ + long_term_loans_payable?: number; + /** + * @description 負債です。単位はドルです。 + * @example 1234 + */ + liabilities?: number; + /** + * @description 株主資本です。単位はドルです。 + * @example 1234 + */ + share_holders_equity?: number; + /** + * @description 利益剰余金です。単位はドルです。 + * @example 1234 + */ + retained_earnings?: number; + /** + * @description 純資産です。単位はドルです。 + * @example 1234 + */ + net_assets?: number; + /** + * @description 売上です。単位はドルです。 + * @example 1234 + */ + net_sales?: number; + /** + * @description 売上原価です。単位はドルです。 + * @example 1234 + */ + cost_of_sales?: number; + /** + * @description 売上総利益です。単位はドルです。 + * @example 1234 + */ + gross_profit?: number; + /** + * @description 販売費および一般管理費です。単位はドルです。 + * @example 1234 + */ + sga?: number; + /** + * @description 営業利益です。単位はドルです。 + * @example 1234 + */ + operating_income?: number; + /** + * @description 営業外費用です。単位はドルです。 + * @example 1234 + */ + nonoperating_expenses?: number; + /** + * @description 税引前当期純利益です。単位はドルです。 + * @example 1234 + */ + income_before_incometaxes?: number; + /** + * @description 法人税等です。単位はドルです。 + * @example 1234 + */ + income_taxes?: number; + /** + * @description 営業キャッシュフローです。単位はドルです。 + * @example 1234 + */ + operating_cash_flow?: number; + /** + * @description 投資キャッシュフローです。単位はドルです。 + * @example 1234 + */ + investment_cash_flow?: number; + /** + * @description 財務キャッシュフローです。単位はドルです。 + * @example 1234 + */ + financial_cash_flow?: number; + /** + * @description 減価償却費です。単位はドルです。 + * @example 1234 + */ + depreciation?: number; + /** + * @description 企業名です。 + * @example foo + */ + company_name?: string; + /** + * @description 純利益です。単位はドルです。 + * @example 1234 + */ + net_income?: number; + /** + * @description 販促費です。単位はドルです。 + * @example 1234 + */ + promotion?: number; + /** + * @description 買掛金です。単位はドルです。 + * @example 1234 + */ + accounts_payable?: number; + /** + * @description 有形固定資産です。単位はドルです。 + * @example 1234 + */ + tangible_fixed_assets?: number; + /** + * @description 棚卸資産です。単位はドルです。 + * @example 1234 + */ + inventories?: number; + /** + * @description 支払利息です。単位はドルです。 + * @example 1234 + */ + interest_expense?: number; + /** + * @description 売掛金です。単位はドルです。 + * @example 1234 + */ + accounts_receivable?: number; + /** + * @description のれんです。単位はドルです。 + * @example 1234 + */ + good_will?: number; + /** + * @description 受取手形です。単位はドルです。 + * @example 1234 + */ + notes_receivable?: number; + /** + * @description 短期借入金です。単位はドルです。 + * @example 1234 + */ + short_term_loans_payable?: number; + /** + * @description リース債務(固定負債)です。単位はドルです。 + * @example 1234 + */ + lease_obligations_ncl?: number; + /** + * @description のれん償却費です。単位はドルです。 + * @example 1234 + */ + amortization?: number; + /** + * @description リース債務(流動負債)です。単位はドルです。 + * @example 1234 + */ + current_lease_obligations?: number; + /** + * @description 有形固定資産の取得による支出です。単位はドルです。 + * @example 1234 + */ + purchase_of_property?: number; + /** + * @description 無形固定資産の取得による支出です。単位はドルです。 + * @example 1234 + */ + purchase_of_intangible_assets?: number; + /** + * @description 研究開発費です。単位はドルです。 + * @example 1234 + */ + r_and_d_expenses_ga?: number; + /** + * @description 受取利息です。単位はドルです。 + * @example 1234 + */ + interest_income?: number; + /** + * @description 有価証券です。単位はドルです。 + * @example 1234 + */ + current_securities?: number; + /** + * @description 自己株数です。単位は株です。 + * @example 1234 + */ + treasury_stock?: number; + /** + * @description 売上債権の増減額です。単位はドルです。 + * @example 1234 + */ + decrease_trade_receivables_op_cf?: number; + /** + * @description 棚卸資産の増減額です。単位はドルです。 + * @example 1234 + */ + decrease_inventories_op_cf?: number; + /** + * @description 仕入債務の増減額です。単位はドルです。 + * @example 1234 + */ + increase_trade_payables_op_cf?: number; + /** + * @description 有価証券の取得による支出です。単位はドルです。 + * @example 1234 + */ + purchase_of_securities?: number; + /** + * @description 有価証券の売却・償還による収入です。単位はドルです。 + * @example 1234 + */ + sale_of_securities?: number; + /** + * @description 有形固定資産の売却による収入です。単位はドルです。 + * @example 1234 + */ + sale_of_property?: number; + /** + * @description 長期借入れによる収入です。単位はドルです。 + * @example 1234 + */ + long_term_debt_issuance?: number; + /** + * @description 長期借入金の返済による支出です。単位はドルです。 + * @example 1234 + */ + long_term_debt_repayment?: number; + /** + * @description 固定資産です。単位はドルです。 + * @example 1234 + */ + non_current_assets?: number; + /** + * @description 固定負債です。単位はドルです。 + * @example 1234 + */ + non_current_liabilities?: number; + /** + * @description 有利子負債です。単位はドルです。 + * @example 1234 + */ + debt?: number; + /** + * @description EBITDA(実績)です。単位はドルです。 + * @example 1234 + */ + ebitda_actual?: number; + /** + * Format: float + * @description 当期純利益率です。単位は%です。 + * @example 123.4 + */ + net_profit_margin?: number; + /** + * @description 純有利子負債です。単位はドルです。 + * @example 1234 + */ + net_debt?: number; + /** + * Format: float + * @description 売上総利益率です。単位は%です。 + * @example 123.4 + */ + gross_margin?: number; + /** + * Format: float + * @description 営業利益率です。単位は%です。 + * @example 123.4 + */ + operating_margin?: number; + /** + * Format: float + * @description 実質法人税率です。単位は%です。 + * @example 123.4 + */ + real_corp_tax_rate?: number; + /** + * Format: float + * @description 現金総資産比率です。単位は%です。 + * @example 123.4 + */ + cash_assets_ratio?: number; + /** + * Format: float + * @description 流動比率です。単位は%です。 + * @example 123.4 + */ + current_ratio?: number; + /** + * @description 売上債権です。単位はドルです。 + * @example 1234 + */ + trade_receivables?: number; + /** + * Format: float + * @description 有利子負債/総資産比率です。単位は%です。 + * @example 123.4 + */ + debt_assets_ratio?: number; + /** + * Format: float + * @description 支払利息/営業利益比率です。単位は%です。 + * @example 123.4 + */ + interest_op_income_ratio?: number; + /** + * Format: float + * @description 販管費/売上率です。単位は%です。 + * @example 123.4 + */ + sga_ratio?: number; + /** + * Format: float + * @description 減価償却費/粗利比率です。単位は%です。 + * @example 123.4 + */ + depreciation_gross_profit_ratio?: number; + /** + * Format: float + * @description 研究開発費/売上比率です。単位は%です。 + * @example 123.4 + */ + r_and_d_ratio?: number; + /** + * Format: float + * @description 営業キャッシュフロー/売上比率です。単位は%です。 + * @example 123.4 + */ + net_sales_op_cash_ratio?: number; + /** + * Format: float + * @description インタレストカバレッジレシオです。単位は倍です。 + * @example 123.4 + */ + interest_coverage_ratio?: number; + /** + * @description 自己資本です。単位はドルです。 + * @example 1234 + */ + equity?: number; + /** + * @description 仕入債務です。単位はドルです。 + * @example 1234 + */ + trade_payables?: number; + /** + * Format: float + * @description 財務レバレッジです。単位は倍です。 + * @example 123.4 + */ + financial_leverage?: number; + /** + * Format: float + * @description 自己資本比率です。単位は%です。 + * @example 123.4 + */ + equity_ratio?: number; + /** + * Format: float + * @description DE比率です。単位は%です。 + * @example 123.4 + */ + de_ratio?: number; + /** + * @description 運転資本です。単位はドルです。 + * @example 1234 + */ + working_capital?: number; + /** + * @description アクルーアルです。単位はドルです。 + * @example 1234 + */ + accrual?: number; + /** + * Format: float + * @description 自己株式調整済負債比率です。単位は%です。 + * @example 123.4 + */ + adjusted_debt_ratio?: number; + /** + * @description フリーキャッシュフローです。単位はドルです。 + * @example 1234 + */ + free_cf?: number; + /** + * @description 資本金です。単位はドルです。 + * @example 1234 + */ + capital_stock?: number; + /** + * Format: float + * @description 総資産回転率です。単位は倍です。 + * @example 123.4 + */ + total_asset_turnover?: number; + /** + * Format: float + * @description ROAです。単位は%です。 + * @example 123.4 + */ + roa?: number; + /** + * Format: float + * @description 現金売上倍率です。単位は倍です。 + * @example 123.4 + */ + cash_monthly_sales_ratio?: number; + /** + * Format: float + * @description 売上債権回転期間です。単位は日です。 + * @example 123.4 + */ + accounts_receivable_turnover?: number; + /** + * Format: float + * @description 棚卸資産回転期間です。単位は日です。 + * @example 123.4 + */ + inventory_turnover?: number; + /** + * Format: float + * @description 有形固定資産回転率です。単位は%です。 + * @example 123.4 + */ + tangible_fixed_assets_turnover?: number; + /** + * Format: float + * @description 有利子負債/月商比率です。単位はヶ月です。 + * @example 123.4 + */ + debt_monthly_sales_ratio?: number; + /** + * Format: float + * @description 有利子負債/営業キャッシュフロー倍率です。単位は倍です。 + * @example 123.4 + */ + cf_debt_ratio?: number; + /** + * Format: float + * @description ROEです。単位は%です。 + * @example 123.4 + */ + roe?: number; + /** + * Format: float + * @description 実質ROEです。単位は%です。 + * @example 123.4 + */ + real_roe?: number; + /** + * Format: float + * @description ROICです。単位は%です。 + * @example 123.4 + */ + roic?: number; + /** + * Format: float + * @description ネットD純利益比率です。単位は倍です。 + * @example 123.4 + */ + net_debt_net_income_ratio?: number; + /** + * Format: float + * @description 仕入債務回転期間です。単位は日です。 + * @example 123.4 + */ + trade_payable_turnover?: number; + /** + * Format: float + * @description CCCです。単位は日です。 + * @example 123.4 + */ + ccc?: number; + /** + * @description 売上(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + net_sales_3m?: number; + /** + * @description 売上原価(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + cost_of_sales_3m?: number; + /** + * @description 販売費および一般管理費(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + sga_3m?: number; + /** + * @description 営業利益(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + operating_income_3m?: number; + /** + * @description 支払利息(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + interest_expense_3m?: number; + /** + * @description 営業外費用(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + nonoperating_expenses_3m?: number; + /** + * @description 税引前当期純利益(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + income_before_incometaxes_3m?: number; + /** + * @description 法人税等(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + income_taxes_3m?: number; + /** + * Format: float + * @description 実質法人税率(3ヶ月)です。単位は%です。 + * @example 123.4 + */ + real_corp_tax_rate_3m?: number; + /** + * @description 純利益(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + net_income_3m?: number; + /** + * @description EBITDA(実績・3ヶ月)です。単位はドルです。 + * @example 1234 + */ + ebitda_3m?: number; + /** + * @description 減価償却費(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + depreciation_3m?: number; + /** + * @description のれん償却費(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + amortization_3m?: number; + /** + * @description 売上債権の増減額(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + decrease_trade_receivables_op_cf_3m?: number; + /** + * @description 棚卸資産の増減額(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + decrease_inventories_op_cf_3m?: number; + /** + * @description 仕入債務の増減額(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + increase_trade_payables_op_cf_3m?: number; + /** + * @description 営業キャッシュフロー(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + netcash_provided_by_operating_activities_3m?: number; + /** + * @description 投資キャッシュフロー(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + netcash_provided_by_investment_activities_3m?: number; + /** + * @description 長期借入れによる収入(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + long_term_debt_issuance_3m?: number; + /** + * @description 長期借入金の返済による支出(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + long_term_debt_repayment_3m?: number; + /** + * @description 財務キャッシュフロー(3ヶ月)です。単位はドルです。 + * @example 1234 + */ + netcash_provided_by_financing_activities_3m?: number; + }; + 'data-19': { + /** + * @description リソースの特定するためのIDです。 + * @example 0001652044:2020Q4 + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Us::Company::Quarterly" が入ります。 + * + * @example Api::V4::Us::Company::Quarterly + */ + type: string; + attributes: components['schemas']['attributes-17']; + }; + 'response-19': { + data: components['schemas']['data-19']; + }; + 'attributes-18': { + /** + * @description CIKです。 + * @example 0001652044 + */ + cik: string; + /** + * @description 銘柄コードです。 + * @example GOOG + */ + ticker: string; + /** + * Format: date + * @description 上場日です。上場した月が不明な場合は1月、日が不明の場合は1日が使用されます。 + * @example 2020-09-06 + */ + listing_date?: string; + }; + 'data-20': { + /** + * @description リソースの特定するためのIDです。 + * @example 0001652044:GOOG + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Us::Company::Stock" が入ります。 + * + * @example Api::V4::Us::Company::Stock + */ + type: string; + attributes: components['schemas']['attributes-18']; + }; + 'response-20': { + data: components['schemas']['data-20']; + }; + 'attributes-19': { + /** + * @description CIKです。 + * @example 0001652044 + */ + cik: string; + /** + * @description 銘柄コードです。 + * @example GOOG + */ + ticker: string; + /** + * Format: date + * @description 日付です。 + * @example 2020-09-06 + */ + date: string; + /** + * Format: float + * @description 配当利回り(実績)です。単位はドルです。 + * @example 123.4 + */ + dividend_yield_actual?: number; + /** + * @description 時価総額です。単位はドルです。 + * @example 1234 + */ + market_capital?: number; + }; + 'data-21': { + /** + * @description リソースの特定するためのIDです。 + * @example 0001652044:GOOG:2020-09-06 + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Us::Company::Stock::Daily" が入ります。 + * + * @example Api::V4::Us::Company::Stock::Daily + */ + type: string; + attributes: components['schemas']['attributes-19']; + }; + 'response-21': { + data: components['schemas']['data-21']; + }; + 'attributes-20': { + /** + * @description CIKです。 + * @example 0001652044 + */ + cik: string; + /** + * @description 銘柄コードです。 + * @example GOOG + */ + ticker: string; + /** + * @description 決算年度です。 + * @example 2020 + */ + fiscal_year: number; + /** + * @description 決算四半期です。 + * @example 4 + */ + fiscal_quarter: number; + /** + * @description 株式総数です。単位は株です。 + * @example 1234 + */ + num_of_shares?: number; + /** + * Format: float + * @description EPSです。単位はドルです。 + * @example 123.4 + */ + eps_actual?: number; + /** + * Format: float + * @description 配当金(実績)です。単位はドルです。 + * @example 123.4 + */ + dividend?: number; + /** + * Format: float + * @description 配当性向です。単位は%です。 + * @example 123.4 + */ + dividend_payout_ratio?: number; + /** + * Format: float + * @description 自己資本配当率です。単位は%です。 + * @example 123.4 + */ + doe?: number; + /** + * Format: float + * @description BPSです。単位はドルです。 + * @example 123.4 + */ + bps?: number; + /** + * Format: float + * @description EPS(3ヶ月)です。単位はドルです。 + * @example 123.4 + */ + eps_actual_3m?: number; + /** + * Format: float + * @description 配当金(実績・3ヶ月)です。単位はドルです。 + * @example 123.4 + */ + dividend_per_share_3m?: number; + }; + 'data-22': { + /** + * @description リソースの特定するためのIDです。 + * @example 0001652044:GOOG:2020Q1 + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Us::Company::Stock::Quarterly" が入ります。 + * + * @example Api::V4::Us::Company::Stock::Quarterly + */ + type: string; + attributes: components['schemas']['attributes-20']; + }; + 'response-22': { + data: components['schemas']['data-22']; + }; + 'attributes-21': { + /** + * @description ダウンロード対象のデータセット名です。 + * @example jp-company-list + */ + name: string; + /** + * Format: uri + * @description ダウンロードリンクのURLです。 + * @example https://example.com/download_link/1c6a5615848b7df6bb4505 + */ + url: string; + /** + * Format: date-time + * @description ダウンロードリンクの有効期限です。RFC3339形式です。 + * @example 2023-09-16T06:05:40Z + */ + expires_at: string; + }; + 'data-23': { + /** + * @description リソースの特定に利用されるIDです。 + * @example 1c6a5615848b7df6bb4505 + */ + id: string; + /** + * @description リソースオブジェクトを識別するための文字列です。 + * 常に "Api::V4::Metadata::DownloadLink" が入ります。 + * + * @example Api::V4::Metadata::DownloadLink + */ + type: string; + attributes: components['schemas']['attributes-21']; + }; + 'response-23': { + data: components['schemas']['data-23']; + }; + }; + responses: { + /** @description **Unauthorized** + * APIキーが設定されていない、または不正なAPIキーを使ってリクエストした場合に401となります。 + * */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description **Forbidden** + * リクエスト数に制限が設けられているエンドポイントに対して、制限を超えた状態でリクエストした場合に403となります。 + * */ + 403: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description **Not Found** + * 指定したリソースが存在しない場合などに404となります。 + * */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description **Too Many Requests** + * Rate Limitを超える頻度でリクエストした場合に429となります。 + * */ + 429: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +} +export type $defs = Record; +export interface operations { + 'post-api-v4-jp-document-search': { + parameters: { + query?: never; + header: { + /** @description 常に 'application/json' を指定してください。 + * */ + 'Content-Type': 'application/json'; + }; + path?: never; + cookie?: never; + }; + /** @description 検索条件を指定します。指定した条件をすべて満たす資料が検索されます。 + * すべて任意項目ですが、少なくとも1つ以上の検索条件を指定する必要があります。 + * */ + requestBody: { + content: { + 'application/json': components['schemas']['request_body']; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'post-api-v4-jp-document-download-link': { + parameters: { + query?: never; + header?: never; + path: { + /** @description ダウンロードリンクを作成するドキュメントのID。[資料検索API](#operation/post-api-v4-jp-document-search)の `data.attributes.id` を指定します。 + * */ + doc_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-2']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-jp-companies-show': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。バフェット・コードで利用されている企業ID(10桁英数)、銘柄コード(4桁英数)、法人番号(13桁数字)が指定可能です。 + * */ + company_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-3']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-jp-companies-daily-show': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。バフェット・コードで利用されている企業ID(10桁英数)、銘柄コード(4桁英数)、法人番号(13桁数字)が指定可能です。 + * */ + company_id: string; + /** @description RFC3339形式の日付。また、特別なプレースホルダーとして銘柄ごとの直近営業日を表す`latest`が指定可能です。 */ + date: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-4']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-jp-companies-daily-market-reaction-index': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。バフェット・コードで利用されている企業ID(10桁英数)、銘柄コード(4桁英数)、法人番号(13桁数字)が指定可能です。 + * */ + company_id: string; + /** @description RFC3339形式の日付。また、特別なプレースホルダーとして銘柄ごとの直近営業日を表す`latest`が指定可能です。 */ + date: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-5']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-jp-companies-weekly-stats-index': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。バフェット・コードで利用されている企業ID(10桁英数)、銘柄コード(4桁英数)、法人番号(13桁数字)が指定可能です。 + * */ + company_id: string; + /** @description 年と週番号。ISO8601形式で表される標準形式の週日付から、曜日情報を除外した形式です。 */ + year_week: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-6']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-jp-companies-monthly-stats-index': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。バフェット・コードで利用されている企業ID(10桁英数)、銘柄コード(4桁英数)、法人番号(13桁数字)が指定可能です。 + * */ + company_id: string; + /** @description 年と月。ハイフン区切りの形式です。 */ + year_month: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-7']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-jp-companies-monthly-kpis-index': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。バフェット・コードで利用されている企業ID(10桁英数)、銘柄コード(4桁英数)、法人番号(13桁数字)が指定可能です。 + * */ + company_id: string; + /** @description 年と月。ハイフン区切りの形式です。 */ + year_month: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-8']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-jp-companies-quarterly-show': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。バフェット・コードで利用されている企業ID(10桁英数)、銘柄コード(4桁英数)、法人番号(13桁数字)が指定可能です。 + * */ + company_id: string; + /** @description 決算期を示す決算年度年と四半期。`Q`で結合された形式です。 + * また、特別なプレースホルダーとしてその企業の最新決算年度を表す`LY`と最新四半期を表す`LQ`が使用できます。 + * `LY`と`LQ`は、`LY-1`や`LQ-1`のようにオフセットを指定して任意の四半期に遡ることが可能です。 + * */ + year_quarter: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-9']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-jp-companies-quarterly-affiliated-companies-index': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。バフェット・コードで利用されている企業ID(10桁英数)、銘柄コード(4桁英数)、法人番号(13桁数字)が指定可能です。 + * */ + company_id: string; + /** @description 決算期を示す決算年度年と四半期。`Q`で結合された形式です。 */ + year_quarter: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-10']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-jp-companies-quarterly-major-facilities-index': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。バフェット・コードで利用されている企業ID(10桁英数)、銘柄コード(4桁英数)、法人番号(13桁数字)が指定可能です。 + * */ + company_id: string; + /** @description 決算期を示す決算年度年と四半期。`Q`で結合された形式です。 */ + year_quarter: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-11']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-jp-companies-quarterly-long-text-content-show': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。バフェット・コードで利用されている企業ID(10桁英数)、銘柄コード(4桁英数)、法人番号(13桁数字)が指定可能です。 + * */ + company_id: string; + /** @description 決算期を示す決算年度年と四半期。`Q`で結合された形式です。 */ + year_quarter: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-12']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-jp-companies-quarterly-major-shareholders-index': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。バフェット・コードで利用されている企業ID(10桁英数)、銘柄コード(4桁英数)、法人番号(13桁数字)が指定可能です。 + * */ + company_id: string; + /** @description 決算期を示す決算年度年と四半期。`Q`で結合された形式です。 */ + year_quarter: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-13']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-jp-companies-quarterly-segments-index': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。バフェット・コードで利用されている企業ID(10桁英数)、銘柄コード(4桁英数)、法人番号(13桁数字)が指定可能です。 + * */ + company_id: string; + /** @description 決算期を示す決算年度年と四半期。`Q`で結合された形式です。 */ + year_quarter: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-14']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-jp-companies-annually-guidance-revisions-index': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。バフェット・コードで利用されている企業ID(10桁英数)、銘柄コード(4桁英数)、法人番号(13桁数字)が指定可能です。 */ + company_id: string; + /** @description 決算年度。`FY`から始まる形式です。 */ + fiscal_year: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-15']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-jp-companies-similarities-index': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。バフェット・コードで利用されている企業ID(10桁英数)、銘柄コード(4桁英数)、法人番号(13桁数字)が指定可能です。 + * */ + company_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-16']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-us-companies-show': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。CIKが指定可能です。 */ + company_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-17']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-us-companies-daily-show': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。CIKが指定可能です。 */ + company_id: string; + /** @description RFC3339形式の日付。 */ + date: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-18']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-us-companies-quarterly-show': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。CIKが指定可能です。 */ + company_id: string; + /** @description 決算期を示す決算年度年と四半期。`Q`で結合された形式です。 */ + year_quarter: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-19']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-us-companies-stocks-show': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。CIKが指定可能です。 */ + company_id: string; + /** @description 銘柄コード。 */ + stock_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-20']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-us-companies-stocks-daily-show': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。CIKが指定可能です。 */ + company_id: string; + /** @description 銘柄コード。 */ + stock_id: string; + /** @description RFC3339形式の日付。 */ + date: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-21']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'get-api-v4-us-companies-stocks-quarterly-show': { + parameters: { + query?: never; + header?: never; + path: { + /** @description 企業ID。CIKが指定可能です。 */ + company_id: string; + /** @description 銘柄コード。 */ + stock_id: string; + /** @description 決算期を示す決算年度年と四半期。`Q`で結合された形式です。 */ + year_quarter: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-22']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; + 'post-api-v4-metadata-download-link': { + parameters: { + query?: never; + header?: never; + path: { + /** @description メタデータのデータセット名。以下が指定可能です。詳細については概要欄をご確認ください。 + * * `jp-company-list` + * * `us-company-list` + * * `jp-company-resource-last-updates` + * * `us-company-resource-last-updates` + * */ + name: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['response-23']; + }; + }; + 401: components['responses']['401']; + 403: components['responses']['403']; + 404: components['responses']['404']; + 429: components['responses']['429']; + }; + }; +} diff --git a/src/client/index.ts b/src/client/index.ts new file mode 100644 index 0000000..6fc21c9 --- /dev/null +++ b/src/client/index.ts @@ -0,0 +1,11 @@ +import createClient from 'openapi-fetch'; +import { paths } from './api.js'; + +export const createBuffetteCodeClient = (baseUrl: string, apiKey: string) => { + return createClient({ + baseUrl, + headers: { + 'x-api-key': apiKey, + }, + }); +}; diff --git a/src/index.ts b/src/index.ts index 573fd71..3d4fc9f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,12 +7,21 @@ import { import { Server } from '@modelcontextprotocol/sdk/server/index.js'; import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; import { zodToJsonSchema } from 'zod-to-json-schema'; -// import { z } from 'zod'; +import { + CompanyRequestSchema, + CompanyDailyRequestSchema, + CompanyQuarterlyRequestSchema, + CompanyStocksRequestSchema, + CompanyStocksDailyRequestSchema, + CompanyStocksQuarterlyRequestSchema, +} from './schemas.js'; import dotenv from 'dotenv'; -dotenv.config(); +import { createBuffetteCodeClient } from './client/index.js'; -const BUFFETT_CODE_BASE_URL = 'https://api.buffett-code.com'; +dotenv.config(); +const BUFFETT_CODE_BASE_URL = + process.env.BUFFETT_CODE_BASE_URL || 'https://api.buffett-code.com'; const BUFFETT_CODE_API_KEY = process.env.BUFFETT_CODE_API_KEY; if (!BUFFETT_CODE_API_KEY) { throw new Error( @@ -20,17 +29,10 @@ if (!BUFFETT_CODE_API_KEY) { ); } -// Alphabet Inc. -const COMPANY_ID = '0001652044'; - -import { - BaseRequestSchema, - CompanyDailyRequestSchema, - CompanyQuarterlyRequestSchema, - CompanyStocksRequestSchema, - CompanyStocksDailyRequestSchema, - CompanyStocksQuarterlyRequestSchema, -} from './schemas.js'; +const buffetteCodeClient = createBuffetteCodeClient( + BUFFETT_CODE_BASE_URL, + BUFFETT_CODE_API_KEY +); const server = new Server( { @@ -48,36 +50,36 @@ server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { - name: 'buffetcode_get_company', + name: 'buffetcode_get_us_company', description: 'Get company information from Buffett Code', - inputSchema: zodToJsonSchema(BaseRequestSchema), + inputSchema: zodToJsonSchema(CompanyRequestSchema), }, { - name: 'buffetcode_get_company_daily', + name: 'buffetcode_get_us_company_daily', description: 'Get daily company information from Buffett Code for a specific date', inputSchema: zodToJsonSchema(CompanyDailyRequestSchema), }, { - name: 'buffetcode_get_company_quarterly', + name: 'buffetcode_get_us_company_quarterly', description: 'Get quarterly company information from Buffett Code for a specific year and quarter', inputSchema: zodToJsonSchema(CompanyQuarterlyRequestSchema), }, { - name: 'buffetcode_get_company_stocks', + name: 'buffetcode_get_us_company_stocks', description: 'Get company stock information from Buffett Code for a specific stock', inputSchema: zodToJsonSchema(CompanyStocksRequestSchema), }, { - name: 'buffetcode_get_company_stocks_daily', + name: 'buffetcode_get_us_company_stocks_daily', description: 'Get daily company stock information from Buffett Code for a specific stock and date', inputSchema: zodToJsonSchema(CompanyStocksDailyRequestSchema), }, { - name: 'buffetcode_get_company_stocks_quarterly', + name: 'buffetcode_get_us_company_stocks_quarterly', description: 'Get quarterly company stock information from Buffett Code for a specific stock and year-quarter', inputSchema: zodToJsonSchema(CompanyStocksQuarterlyRequestSchema), @@ -93,148 +95,148 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { } switch (request.params.name) { - case 'buffetcode_get_company': { - const response = await fetch( - `${BUFFETT_CODE_BASE_URL}/api/v4/us/companies/${COMPANY_ID}`, + case 'buffetcode_get_us_company': { + const args = CompanyRequestSchema.parse(request.params.arguments); + const company_id = args.companyId; + const response = await buffetteCodeClient.GET( + '/api/v4/us/companies/{company_id}', { - headers: { - 'x-api-key': BUFFETT_CODE_API_KEY, + params: { + path: { + company_id, + }, }, } ); - if (!response.ok) { + if (response.error) { throw new Error('Failed to get'); } - const result = await response.json(); + const result = response.data; return { content: [{ type: 'text', text: JSON.stringify(result) }], }; } - case 'buffetcode_get_company_daily': { - const args = CompanyDailyRequestSchema.parse(request.params.arguments); - const response = await fetch( - `${BUFFETT_CODE_BASE_URL}/api/v4/us/companies/${COMPANY_ID}/daily/${args.date}`, - { - headers: { - 'x-api-key': BUFFETT_CODE_API_KEY, - }, - } + case 'buffetcode_get_us_company_daily': { + const args = CompanyDailyRequestSchema.parse(request.params.arguments); + const company_id = args.companyId; + const response = await buffetteCodeClient.GET( + '/api/v4/us/companies/{company_id}/daily/{date}', + { params: { path: { company_id, date: args.date } } } ); - if (!response.ok) { - throw new Error(`Failed to get daily data: ${response.statusText}`); - } - - const result = await response.json(); + if (response.error) + throw new Error(`Failed to get daily data: ${response.error}`); + const result = response.data; return { content: [{ type: 'text', text: JSON.stringify(result) }], }; } - case 'buffetcode_get_company_quarterly': { + + case 'buffetcode_get_us_company_quarterly': { const args = CompanyQuarterlyRequestSchema.parse( request.params.arguments ); - - const response = await fetch( - `${BUFFETT_CODE_BASE_URL}/api/v4/us/companies/${COMPANY_ID}/quarterly/${args.year_quarter}`, + const company_id = args.companyId; + const response = await buffetteCodeClient.GET( + '/api/v4/us/companies/{company_id}/quarterly/{year_quarter}', { - headers: { - 'x-api-key': BUFFETT_CODE_API_KEY, + params: { + path: { company_id, year_quarter: args.year_quarter }, }, } ); - if (!response.ok) { - throw new Error( - `Failed to get quarterly data: ${response.statusText}` - ); - } - - const result = await response.json(); + if (response.error) + throw new Error(`Failed to get quarterly data: ${response.error}`); + const result = response.data; return { content: [{ type: 'text', text: JSON.stringify(result) }], }; } - case 'buffetcode_get_company_stocks': { - const args = CompanyStocksRequestSchema.parse(request.params.arguments); - const response = await fetch( - `${BUFFETT_CODE_BASE_URL}/api/v4/us/companies/${COMPANY_ID}/stocks/${args.stock_id}`, + case 'buffetcode_get_us_company_stocks': { + const args = CompanyStocksRequestSchema.parse(request.params.arguments); + const company_id = args.companyId; + const response = await buffetteCodeClient.GET( + '/api/v4/us/companies/{company_id}/stocks/{stock_id}', { - headers: { - 'x-api-key': BUFFETT_CODE_API_KEY, + params: { + path: { company_id, stock_id: args.stock_id }, }, } ); - if (!response.ok) { - throw new Error(`Failed to get stock data: ${response.statusText}`); - } - - const result = await response.json(); + if (response.error) + throw new Error(`Failed to get stock data: ${response.error}`); + const result = response.data; return { content: [{ type: 'text', text: JSON.stringify(result) }], }; } - case 'buffetcode_get_company_stocks_daily': { + + case 'buffetcode_get_us_company_stocks_daily': { const args = CompanyStocksDailyRequestSchema.parse( request.params.arguments ); - - const response = await fetch( - `${BUFFETT_CODE_BASE_URL}/api/v4/us/companies/${COMPANY_ID}/stocks/${args.stock_id}/daily/${args.date}`, + const company_id = args.companyId; + const response = await buffetteCodeClient.GET( + '/api/v4/us/companies/{company_id}/stocks/{stock_id}/daily/{date}', { - headers: { - 'x-api-key': BUFFETT_CODE_API_KEY, + params: { + path: { + company_id, + stock_id: args.stock_id, + date: args.date, + }, }, } ); - if (!response.ok) { - throw new Error( - `Failed to get daily stock data: ${response.statusText}` - ); - } - - const result = await response.json(); + if (response.error) + throw new Error(`Failed to get daily stock data: ${response.error}`); + const result = response.data; return { content: [{ type: 'text', text: JSON.stringify(result) }], }; } - case 'buffetcode_get_company_stocks_quarterly': { + + case 'buffetcode_get_us_company_stocks_quarterly': { const args = CompanyStocksQuarterlyRequestSchema.parse( request.params.arguments ); - - const response = await fetch( - `${BUFFETT_CODE_BASE_URL}/api/v4/us/companies/${COMPANY_ID}/stocks/${args.stock_id}/quarterly/${args.year_quarter}`, + const company_id = args.companyId; + const response = await buffetteCodeClient.GET( + '/api/v4/us/companies/{company_id}/stocks/{stock_id}/quarterly/{year_quarter}', { - headers: { - 'x-api-key': BUFFETT_CODE_API_KEY, + params: { + path: { + company_id, + stock_id: args.stock_id, + year_quarter: args.year_quarter, + }, }, } ); - if (!response.ok) { + if (response.error) throw new Error( - `Failed to get quarterly stock data: ${response.statusText}` + `Failed to get quarterly stock data: ${response.error}` ); - } - - const result = await response.json(); + const result = response.data; return { content: [{ type: 'text', text: JSON.stringify(result) }], }; } + default: throw new Error(`Unknown tool: ${request.params.name}`); } diff --git a/src/schemas.ts b/src/schemas.ts index 36f0b75..c31b2af 100644 --- a/src/schemas.ts +++ b/src/schemas.ts @@ -2,7 +2,12 @@ import { z } from 'zod'; export const BaseRequestSchema = z.object({}); +export const CompanyRequestSchema = z.object({ + companyId: z.string().regex(/^[0-9]+$/, 'EDINETコード (例: 0001652044)'), +}); + export const CompanyDailyRequestSchema = z.object({ + companyId: z.string().regex(/^[0-9]+$/, 'EDINETコード (例: 0001652044)'), date: z .string() .regex( @@ -12,16 +17,19 @@ export const CompanyDailyRequestSchema = z.object({ }); export const CompanyQuarterlyRequestSchema = z.object({ + companyId: z.string().regex(/^[0-9]+$/, 'EDINETコード (例: 0001652044)'), year_quarter: z .string() .regex(/^[0-9]{4}Q[0-9]$/, '決算期を示す決算年度年と四半期 (例: 2020Q4)'), }); export const CompanyStocksRequestSchema = z.object({ + companyId: z.string().regex(/^[0-9]+$/, 'EDINETコード (例: 0001652044)'), stock_id: z.string().regex(/^[a-z]+$/, '銘柄コード (例: goog)'), }); export const CompanyStocksDailyRequestSchema = z.object({ + companyId: z.string().regex(/^[0-9]+$/, 'EDINETコード (例: 0001652044)'), stock_id: z.string().regex(/^[a-z]+$/, '銘柄コード (例: goog)'), date: z .string() @@ -32,6 +40,7 @@ export const CompanyStocksDailyRequestSchema = z.object({ }); export const CompanyStocksQuarterlyRequestSchema = z.object({ + companyId: z.string().regex(/^[0-9]+$/, 'EDINETコード (例: 0001652044)'), stock_id: z.string().regex(/^[a-z]+$/, '銘柄コード (例: goog)'), year_quarter: z .string() From 34ce0533ffb33ce6e55f6107b47c320fe3f209e1 Mon Sep 17 00:00:00 2001 From: Ryo Okubo Date: Sat, 10 May 2025 15:17:49 +0900 Subject: [PATCH 3/8] feat: add US company example --- .env.example | 2 + examples/get_us_company.ts | 93 ++++++++++++++++++++++++++++++++++++++ package.json | 3 +- 3 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 .env.example create mode 100644 examples/get_us_company.ts diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..431f98a --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +BUFFETT_CODE_API_KEY=your_api_key_here +BUFFETT_CODE_BASE_URL=https://api.buffett-code.com diff --git a/examples/get_us_company.ts b/examples/get_us_company.ts new file mode 100644 index 0000000..0566a2a --- /dev/null +++ b/examples/get_us_company.ts @@ -0,0 +1,93 @@ +import { Client } from '@modelcontextprotocol/sdk/client/index.js'; +import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'; +import { config } from 'dotenv'; +import { fileURLToPath } from 'node:url'; +import { dirname, resolve } from 'node:path'; +import { CallToolResult, CallToolResultSchema } from '@modelcontextprotocol/sdk/types.js'; + +// Get the current file's directory +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +// Load environment variables from .env file +config(); + +// Get and validate required environment variables +const apiKey = process.env.BUFFETT_CODE_API_KEY; +if (!apiKey) { + throw new Error( + 'BUFFETT_CODE_API_KEY environment variable is required. Set it in your .env file.' + ); +} + +// Compose env for child process +const env = { + BUFFETT_CODE_API_KEY: apiKey, +} as const satisfies Record; + +async function main() { + // Initialize MCP client + const client = new Client( + { + name: 'buffetcode-mcp-example-client', + version: '1.0.0', + }, + { + capabilities: {}, + } + ); + + // Create transport to connect to the server + const transport = new StdioClientTransport({ + command: process.execPath, + args: [ + resolve(__dirname, '../dist/index.js'), // pre-build server + ], + env, + }); + + try { + // Connect to the server + await client.connect(transport); + console.log('Connected to BuffetCode MCP server'); + + // List available tools + const toolsResponse = await client.listTools(); + + console.log('Available tools:'); + toolsResponse.tools.forEach(tool => { + console.log(`- ${tool.name}: ${tool.description}`); + }); + + const response = (await client.callTool( + { + name: 'buffetcode_get_us_company', + arguments: { + companyId: '0001652044', // Google (Alphabet) EDINET code + }, + }, + CallToolResultSchema + )) as CallToolResult; + + if ( + Array.isArray(response.content) && + response.content[0]?.type === 'text' + ) { + const data = JSON.parse(response.content[0].text); + console.log('Company data (example):', data); + } else { + console.error('Unexpected response format for example call'); + } + } catch (error) { + console.error('Error:', error); + process.exit(1); + } finally { + await transport.close(); + console.log('Connection closed.'); + } +} + +main().catch((error) => { + console.error('Fatal error in main:', error); + process.exit(1); +}); \ No newline at end of file diff --git a/package.json b/package.json index c95536e..7d112bb 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "lint:prettier": "prettier --check \"src/**/*.ts\"", "fix": "npm run fix:eslint && npm run fix:prettier", "fix:eslint": "eslint \"src/**/*.ts\" --fix", - "fix:prettier": "prettier --write \"src/**/*.ts\"" + "fix:prettier": "prettier --write \"src/**/*.ts\"", + "examples": "node --import ./ts-node-loader.js examples/get_us_company.ts" }, "repository": { "type": "git", From 9f02822041fce7423a4cd2f7ae82e8735e3c468b Mon Sep 17 00:00:00 2001 From: Ryo Okubo Date: Sat, 10 May 2025 15:22:36 +0900 Subject: [PATCH 4/8] refactor: rename schemas with US prefix and translate error messages to English --- src/index.ts | 40 ++++++++++++++++++++++------------------ src/schemas.ts | 42 +++++++++++++++++++----------------------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/index.ts b/src/index.ts index 3d4fc9f..7f3b7b2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,12 +8,12 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js'; import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; import { zodToJsonSchema } from 'zod-to-json-schema'; import { - CompanyRequestSchema, - CompanyDailyRequestSchema, - CompanyQuarterlyRequestSchema, - CompanyStocksRequestSchema, - CompanyStocksDailyRequestSchema, - CompanyStocksQuarterlyRequestSchema, + USCompanyRequestSchema, + USCompanyDailyRequestSchema, + USCompanyQuarterlyRequestSchema, + USCompanyStocksRequestSchema, + USCompanyStocksDailyRequestSchema, + USCompanyStocksQuarterlyRequestSchema, } from './schemas.js'; import dotenv from 'dotenv'; import { createBuffetteCodeClient } from './client/index.js'; @@ -52,37 +52,37 @@ server.setRequestHandler(ListToolsRequestSchema, async () => { { name: 'buffetcode_get_us_company', description: 'Get company information from Buffett Code', - inputSchema: zodToJsonSchema(CompanyRequestSchema), + inputSchema: zodToJsonSchema(USCompanyRequestSchema), }, { name: 'buffetcode_get_us_company_daily', description: 'Get daily company information from Buffett Code for a specific date', - inputSchema: zodToJsonSchema(CompanyDailyRequestSchema), + inputSchema: zodToJsonSchema(USCompanyDailyRequestSchema), }, { name: 'buffetcode_get_us_company_quarterly', description: 'Get quarterly company information from Buffett Code for a specific year and quarter', - inputSchema: zodToJsonSchema(CompanyQuarterlyRequestSchema), + inputSchema: zodToJsonSchema(USCompanyQuarterlyRequestSchema), }, { name: 'buffetcode_get_us_company_stocks', description: 'Get company stock information from Buffett Code for a specific stock', - inputSchema: zodToJsonSchema(CompanyStocksRequestSchema), + inputSchema: zodToJsonSchema(USCompanyStocksRequestSchema), }, { name: 'buffetcode_get_us_company_stocks_daily', description: 'Get daily company stock information from Buffett Code for a specific stock and date', - inputSchema: zodToJsonSchema(CompanyStocksDailyRequestSchema), + inputSchema: zodToJsonSchema(USCompanyStocksDailyRequestSchema), }, { name: 'buffetcode_get_us_company_stocks_quarterly', description: 'Get quarterly company stock information from Buffett Code for a specific stock and year-quarter', - inputSchema: zodToJsonSchema(CompanyStocksQuarterlyRequestSchema), + inputSchema: zodToJsonSchema(USCompanyStocksQuarterlyRequestSchema), }, ], }; @@ -96,7 +96,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { switch (request.params.name) { case 'buffetcode_get_us_company': { - const args = CompanyRequestSchema.parse(request.params.arguments); + const args = USCompanyRequestSchema.parse(request.params.arguments); const company_id = args.companyId; const response = await buffetteCodeClient.GET( '/api/v4/us/companies/{company_id}', @@ -121,7 +121,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { } case 'buffetcode_get_us_company_daily': { - const args = CompanyDailyRequestSchema.parse(request.params.arguments); + const args = USCompanyDailyRequestSchema.parse( + request.params.arguments + ); const company_id = args.companyId; const response = await buffetteCodeClient.GET( '/api/v4/us/companies/{company_id}/daily/{date}', @@ -138,7 +140,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { } case 'buffetcode_get_us_company_quarterly': { - const args = CompanyQuarterlyRequestSchema.parse( + const args = USCompanyQuarterlyRequestSchema.parse( request.params.arguments ); const company_id = args.companyId; @@ -161,7 +163,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { } case 'buffetcode_get_us_company_stocks': { - const args = CompanyStocksRequestSchema.parse(request.params.arguments); + const args = USCompanyStocksRequestSchema.parse( + request.params.arguments + ); const company_id = args.companyId; const response = await buffetteCodeClient.GET( '/api/v4/us/companies/{company_id}/stocks/{stock_id}', @@ -182,7 +186,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { } case 'buffetcode_get_us_company_stocks_daily': { - const args = CompanyStocksDailyRequestSchema.parse( + const args = USCompanyStocksDailyRequestSchema.parse( request.params.arguments ); const company_id = args.companyId; @@ -209,7 +213,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { } case 'buffetcode_get_us_company_stocks_quarterly': { - const args = CompanyStocksQuarterlyRequestSchema.parse( + const args = USCompanyStocksQuarterlyRequestSchema.parse( request.params.arguments ); const company_id = args.companyId; diff --git a/src/schemas.ts b/src/schemas.ts index c31b2af..b485ca3 100644 --- a/src/schemas.ts +++ b/src/schemas.ts @@ -2,47 +2,43 @@ import { z } from 'zod'; export const BaseRequestSchema = z.object({}); -export const CompanyRequestSchema = z.object({ - companyId: z.string().regex(/^[0-9]+$/, 'EDINETコード (例: 0001652044)'), +export const USCompanyRequestSchema = z.object({ + companyId: z.string().regex(/^[0-9]+$/, 'EDINET code (e.g.: 0001652044)'), }); -export const CompanyDailyRequestSchema = z.object({ - companyId: z.string().regex(/^[0-9]+$/, 'EDINETコード (例: 0001652044)'), +export const USCompanyDailyRequestSchema = z.object({ + companyId: z.string().regex(/^[0-9]+$/, 'EDINET code (e.g.: 0001652044)'), date: z .string() .regex( /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/, - 'RFC3339形式の日付 (例: 2024-01-01)' + 'RFC3339 date string (e.g.: 2024-01-01)' ), }); -export const CompanyQuarterlyRequestSchema = z.object({ - companyId: z.string().regex(/^[0-9]+$/, 'EDINETコード (例: 0001652044)'), - year_quarter: z - .string() - .regex(/^[0-9]{4}Q[0-9]$/, '決算期を示す決算年度年と四半期 (例: 2020Q4)'), +export const USCompanyQuarterlyRequestSchema = z.object({ + companyId: z.string().regex(/^[0-9]+$/, 'EDINET code (e.g.: 0001652044)'), + year_quarter: z.string().regex(/^[0-9]{4}Q[0-9]$/, 'e.g.: 2020Q4'), }); -export const CompanyStocksRequestSchema = z.object({ - companyId: z.string().regex(/^[0-9]+$/, 'EDINETコード (例: 0001652044)'), - stock_id: z.string().regex(/^[a-z]+$/, '銘柄コード (例: goog)'), +export const USCompanyStocksRequestSchema = z.object({ + companyId: z.string().regex(/^[0-9]+$/, 'EDINET code (e.g.: 0001652044)'), + stock_id: z.string().regex(/^[a-z]+$/, 'stock ID (e.g.: goog)'), }); -export const CompanyStocksDailyRequestSchema = z.object({ - companyId: z.string().regex(/^[0-9]+$/, 'EDINETコード (例: 0001652044)'), - stock_id: z.string().regex(/^[a-z]+$/, '銘柄コード (例: goog)'), +export const USCompanyStocksDailyRequestSchema = z.object({ + companyId: z.string().regex(/^[0-9]+$/, 'EDINET code (e.g.: 0001652044)'), + stock_id: z.string().regex(/^[a-z]+$/, 'stock ID (e.g.: goog)'), date: z .string() .regex( /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/, - 'RFC3339形式の日付 (例: 2024-01-01)' + 'RFC3339 date string (e.g.: 2024-01-01)' ), }); -export const CompanyStocksQuarterlyRequestSchema = z.object({ - companyId: z.string().regex(/^[0-9]+$/, 'EDINETコード (例: 0001652044)'), - stock_id: z.string().regex(/^[a-z]+$/, '銘柄コード (例: goog)'), - year_quarter: z - .string() - .regex(/^[0-9]{4}Q[0-9]$/, '決算期を示す決算年度年と四半期 (例: 2020Q4)'), +export const USCompanyStocksQuarterlyRequestSchema = z.object({ + companyId: z.string().regex(/^[0-9]+$/, 'EDINET code (e.g.: 0001652044)'), + stock_id: z.string().regex(/^[a-z]+$/, 'stock ID (e.g.: goog)'), + year_quarter: z.string().regex(/^[0-9]{4}Q[0-9]$/, 'e.g.: 2020Q4'), }); From df8d3d48579e6806e72dac02c2f002c782fa7e92 Mon Sep 17 00:00:00 2001 From: Ryo Okubo Date: Sat, 10 May 2025 15:46:14 +0900 Subject: [PATCH 5/8] fix: correct spelling from buffette/buffet to buffett throughout codebase --- README.md | 22 +++++++++++----------- examples/get_us_company.ts | 4 ++-- package.json | 16 ++++++++-------- src/index.ts | 28 ++++++++++++++-------------- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index ac55826..a85e84b 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ -# buffette-code-mcp-server +# buffett-code-mcp-server -A [MCP(Model Context Protocol)](https://www.anthropic.com/news/model-context-protocol) server that accesses to [buffet code API](https://docs.buffett-code.com/api/). +A [MCP(Model Context Protocol)](https://www.anthropic.com/news/model-context-protocol) server that accesses to [buffett-code API](https://docs.buffett-code.com/api/). ## Features Available tools: -- `buffetcode_get_company` - Get company information from Buffett Code -- `buffetcode_get_company_daily` - Get daily company information from Buffett Code for a specific date -- `buffetcode_get_company_quarterly` - Get quarterly company information from Buffett Code for a specific year and quarter -- `buffetcode_get_company_stocks` - Get company stock information from Buffett Code for a specific stock -- `buffetcode_get_company_stocks_daily` Get daily company stock information from Buffett Code for a specific stock and date -- `buffetcode_get_company_stocks_quarterly` - Get quarterly company stock information from Buffett Code for a specific stock and year-quarter +- `buffett_code_get_company` - Get company information from Buffett Code +- `buffett_code_get_company_daily` - Get daily company information from Buffett Code for a specific date +- `buffett_code_get_company_quarterly` - Get quarterly company information from Buffett Code for a specific year and quarter +- `buffett_code_get_company_stocks` - Get company stock information from Buffett Code for a specific stock +- `buffett_code_get_company_stocks_daily` Get daily company stock information from Buffett Code for a specific stock and date +- `buffett_code_get_company_stocks_quarterly` - Get quarterly company stock information from Buffett Code for a specific stock and year-quarter ## Quick Start @@ -29,10 +29,10 @@ TBD ```json ... - "buffet-code": { + "buffett-code": { "command": "node", "args": [ - "/path/to/buffet-code-mcp-server/dist/index.js" + "/path/to/buffett-code-mcp-server/dist/index.js" ], "env": { } @@ -52,7 +52,7 @@ npm install -D tsx ```json { "mcpServers": { - "buffet-code": { + "buffett-code": { "command": "npx", "args": [ "tsx", diff --git a/examples/get_us_company.ts b/examples/get_us_company.ts index 0566a2a..d6dfe54 100644 --- a/examples/get_us_company.ts +++ b/examples/get_us_company.ts @@ -29,7 +29,7 @@ async function main() { // Initialize MCP client const client = new Client( { - name: 'buffetcode-mcp-example-client', + name: 'buffett-code-mcp-example-client', version: '1.0.0', }, { @@ -61,7 +61,7 @@ async function main() { const response = (await client.callTool( { - name: 'buffetcode_get_us_company', + name: 'buffett_code_get_us_company', arguments: { companyId: '0001652044', // Google (Alphabet) EDINET code }, diff --git a/package.json b/package.json index 7d112bb..d0abe8e 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { - "name": "buffette-code-mcp-server", + "name": "buffett-code-mcp-server", "version": "0.0.1", "description": "A MCP(Model Context Protocol) server that accesses to Buffett Code API", "main": "dist/index.js", "type": "module", "bin": { - "buffette-code-mcp-server": "dist/index.js" + "buffett-code-mcp-server": "dist/index.js" }, "files": [ "dist", @@ -22,22 +22,22 @@ "fix": "npm run fix:eslint && npm run fix:prettier", "fix:eslint": "eslint \"src/**/*.ts\" --fix", "fix:prettier": "prettier --write \"src/**/*.ts\"", - "examples": "node --import ./ts-node-loader.js examples/get_us_company.ts" + "examples": "npm run build && node --import ./ts-node-loader.js examples/get_us_company.ts" }, "repository": { "type": "git", - "url": "git+https://github.com/syucream/buffette-code-mcp-server.git" + "url": "git+https://github.com/syucream/buffett-code-mcp-server.git" }, "keywords": [ - "buffette-code", - "mcp" + "mcp", + "buffett-code" ], "author": "syucream", "license": "MIT", "bugs": { - "url": "https://github.com/syucream/buffette-code-mcp-server/issues" + "url": "https://github.com/syucream/buffett-code-mcp-server/issues" }, - "homepage": "https://github.com/syucream/buffette-code-mcp-server#readme", + "homepage": "https://github.com/syucream/buffett-code-mcp-server#readme", "dependencies": { "@modelcontextprotocol/sdk": "^1.0.4", "@types/node": "^20.10.3", diff --git a/src/index.ts b/src/index.ts index 7f3b7b2..b2112f6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -36,7 +36,7 @@ const buffetteCodeClient = createBuffetteCodeClient( const server = new Server( { - name: 'buffetcode-mcp-server', + name: 'buffett-code-mcp-server', version: '0.0.1', }, { @@ -50,36 +50,36 @@ server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { - name: 'buffetcode_get_us_company', + name: 'buffett_code_get_us_company', description: 'Get company information from Buffett Code', inputSchema: zodToJsonSchema(USCompanyRequestSchema), }, { - name: 'buffetcode_get_us_company_daily', + name: 'buffett_code_get_us_company_daily', description: 'Get daily company information from Buffett Code for a specific date', inputSchema: zodToJsonSchema(USCompanyDailyRequestSchema), }, { - name: 'buffetcode_get_us_company_quarterly', + name: 'buffett_code_get_us_company_quarterly', description: 'Get quarterly company information from Buffett Code for a specific year and quarter', inputSchema: zodToJsonSchema(USCompanyQuarterlyRequestSchema), }, { - name: 'buffetcode_get_us_company_stocks', + name: 'buffett_code_get_us_company_stocks', description: 'Get company stock information from Buffett Code for a specific stock', inputSchema: zodToJsonSchema(USCompanyStocksRequestSchema), }, { - name: 'buffetcode_get_us_company_stocks_daily', + name: 'buffett_code_get_us_company_stocks_daily', description: 'Get daily company stock information from Buffett Code for a specific stock and date', inputSchema: zodToJsonSchema(USCompanyStocksDailyRequestSchema), }, { - name: 'buffetcode_get_us_company_stocks_quarterly', + name: 'buffett_code_get_us_company_stocks_quarterly', description: 'Get quarterly company stock information from Buffett Code for a specific stock and year-quarter', inputSchema: zodToJsonSchema(USCompanyStocksQuarterlyRequestSchema), @@ -95,7 +95,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { } switch (request.params.name) { - case 'buffetcode_get_us_company': { + case 'buffett_code_get_us_company': { const args = USCompanyRequestSchema.parse(request.params.arguments); const company_id = args.companyId; const response = await buffetteCodeClient.GET( @@ -120,7 +120,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { }; } - case 'buffetcode_get_us_company_daily': { + case 'buffett_code_get_us_company_daily': { const args = USCompanyDailyRequestSchema.parse( request.params.arguments ); @@ -139,7 +139,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { }; } - case 'buffetcode_get_us_company_quarterly': { + case 'buffett_code_get_us_company_quarterly': { const args = USCompanyQuarterlyRequestSchema.parse( request.params.arguments ); @@ -162,7 +162,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { }; } - case 'buffetcode_get_us_company_stocks': { + case 'buffett_code_get_us_company_stocks': { const args = USCompanyStocksRequestSchema.parse( request.params.arguments ); @@ -185,7 +185,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { }; } - case 'buffetcode_get_us_company_stocks_daily': { + case 'buffett_code_get_us_company_stocks_daily': { const args = USCompanyStocksDailyRequestSchema.parse( request.params.arguments ); @@ -212,7 +212,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { }; } - case 'buffetcode_get_us_company_stocks_quarterly': { + case 'buffett_code_get_us_company_stocks_quarterly': { const args = USCompanyStocksQuarterlyRequestSchema.parse( request.params.arguments ); @@ -255,7 +255,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { async function runServer() { const transport = new StdioServerTransport(); await server.connect(transport); - console.error('Buffette Code MCP Server running on stdio'); + console.error('Buffett Code MCP Server running on stdio'); } runServer().catch((error) => { From 4fe28be7e2bc6c8f1cf544e2e3ded4a8c308fe75 Mon Sep 17 00:00:00 2001 From: Ryo Okubo Date: Sat, 10 May 2025 15:54:47 +0900 Subject: [PATCH 6/8] docs: update API endpoint names to include 'us' prefix for clarity --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a85e84b..30baf23 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,12 @@ A [MCP(Model Context Protocol)](https://www.anthropic.com/news/model-context-pro Available tools: -- `buffett_code_get_company` - Get company information from Buffett Code -- `buffett_code_get_company_daily` - Get daily company information from Buffett Code for a specific date -- `buffett_code_get_company_quarterly` - Get quarterly company information from Buffett Code for a specific year and quarter -- `buffett_code_get_company_stocks` - Get company stock information from Buffett Code for a specific stock -- `buffett_code_get_company_stocks_daily` Get daily company stock information from Buffett Code for a specific stock and date -- `buffett_code_get_company_stocks_quarterly` - Get quarterly company stock information from Buffett Code for a specific stock and year-quarter +- `buffett_code_get_us_company` - Get company information from Buffett Code +- `buffett_code_get_us_company_daily` - Get daily company information from Buffett Code for a specific date +- `buffett_code_get_us_company_quarterly` - Get quarterly company information from Buffett Code for a specific year and quarter +- `buffett_code_get_us_company_stocks` - Get company stock information from Buffett Code for a specific stock +- `buffett_code_get_us_company_stocks_daily` Get daily company stock information from Buffett Code for a specific stock and date +- `buffett_code_get_us_company_stocks_quarterly` - Get quarterly company stock information from Buffett Code for a specific stock and year-quarter ## Quick Start From 869622b6d1eec62a608686b887f1b48fc2be702f Mon Sep 17 00:00:00 2001 From: Ryo Okubo Date: Sat, 10 May 2025 16:10:11 +0900 Subject: [PATCH 7/8] chore: consolidate env files and update API key documentation --- .env.example | 2 -- .env.sample | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 .env.example diff --git a/.env.example b/.env.example deleted file mode 100644 index 431f98a..0000000 --- a/.env.example +++ /dev/null @@ -1,2 +0,0 @@ -BUFFETT_CODE_API_KEY=your_api_key_here -BUFFETT_CODE_BASE_URL=https://api.buffett-code.com diff --git a/.env.sample b/.env.sample index 317b096..5117f52 100644 --- a/.env.sample +++ b/.env.sample @@ -1,3 +1,3 @@ BUFFETT_CODE_BASE_URL=https://api.buffett-code.com -# for testing, ref. https://docs.buffett-code.com/api/#section/%E8%AA%8D%E8%A8%BC/API +# the official API key for testing, ref. https://docs.buffett-code.com/api/#section/%E8%AA%8D%E8%A8%BC/API BUFFETT_CODE_API_KEY=sAJGq9JH193KiwnF947v74KnDYkO7z634LWQQfPY \ No newline at end of file From 9d0efc62323ccf112ed3252d1fd6b676a3d472ba Mon Sep 17 00:00:00 2001 From: Ryo Okubo Date: Sat, 10 May 2025 16:29:48 +0900 Subject: [PATCH 8/8] chore: bump version to 0.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d0abe8e..27d3d32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "buffett-code-mcp-server", - "version": "0.0.1", + "version": "0.1.0", "description": "A MCP(Model Context Protocol) server that accesses to Buffett Code API", "main": "dist/index.js", "type": "module",