モモンガサーチAPI

Generated from OpenAPI

API Reference

このページは momonga-search-api の FastAPI / Pydantic schema から生成した OpenAPI JSON を表示しています。

手書きのガイドは使い方を説明し、endpoint、request、response の詳細はコード由来の OpenAPI を正本にします。

API

GET/health

Health

stability: unspecifiedusage type: unspecifiedcredits: unspecified

Responses

StatusDescriptionSchemaError codes
200Successful ResponseHealthResponse-
GET/health/ready

Ready

stability: unspecifiedusage type: unspecifiedcredits: unspecified

Responses

StatusDescriptionSchemaError codes
200Successful ResponseHealthResponse-

0-credit

GET/v1/documents

List documents

公開対象の文書を timeline_at の降順で一覧します。timeline_since / timeline_until も timeline_at 基準です。security_codes なしで市場全体を一覧する場合は timeline_since が必須です。next_cursor が null でなければ、同じフィルタに cursor を付けて次ページを取得します。

stability: stableusage type: 0-credit APIcredits: 0

Parameters

NameInRequiredSchema
security_codesquerynostring[] | null
document_typesquerynostring[] | null
document_familiesqueryno"edinet_filing" | "ir_material" | "timely_disclosure"[] | null
timeline_sincequerynostring:date | null
timeline_untilquerynostring:date | null
limitquerynointeger
cursorquerynostring | null

Responses

StatusDescriptionSchemaError codes
200Successful ResponseDocumentListResponse-
400The document list request is invalid.ProblemDetails
invalid_cursorinvalid_date_rangeinvalid_document_familyinvalid_query_parametermissing_required_filter
401Authentication failed.ProblemDetails
authentication_requiredinvalid_api_key
403The API key is valid but the account cannot access this API.ProblemDetails
access_not_enabled
422Validation ErrorHTTPValidationError-
429Rate limit or usage limit exceeded.ProblemDetails
quota_exceededrate_limit_exceeded
500Internal server error.ProblemDetails
internal_error
GET/v1/documents/{document_id}

Get document

文書のメタデータと取得可否を返します。

stability: stableusage type: 0-credit APIcredits: 0

Parameters

NameInRequiredSchema
document_idpathyesstring

Responses

StatusDescriptionSchemaError codes
200Successful ResponseDocumentSummary-
401Authentication failed.ProblemDetails
authentication_requiredinvalid_api_key
403The API key is valid but the account cannot access this API.ProblemDetails
access_not_enabled
404The requested document was not found.ProblemDetails
not_found
422Validation ErrorHTTPValidationError-
429Rate limit or usage limit exceeded.ProblemDetails
quota_exceededrate_limit_exceeded
500Internal server error.ProblemDetails
internal_error
GET/v1/documents/{document_id}/toc

Get document TOC

本文取得に使えるセクションを toc[] として返します。toc[].section_id は GET /v1/documents/{document_id}/content?sections=... に渡せます。

stability: stableusage type: 0-credit APIcredits: 0

Parameters

NameInRequiredSchema
document_idpathyesstring

Responses

StatusDescriptionSchemaError codes
200Successful ResponseDocumentTocResponse-
401Authentication failed.ProblemDetails
authentication_requiredinvalid_api_key
403The API key is valid but the account cannot access this API.ProblemDetails
access_not_enabled
404The requested document was not found.ProblemDetails
not_found
409Document content is not available for delivery.ProblemDetails
content_not_available
422Validation ErrorHTTPValidationError-
429Rate limit or usage limit exceeded.ProblemDetails
quota_exceededrate_limit_exceeded
500Internal server error.ProblemDetails
internal_error
GET/v1/documents/{document_id}/page-images

List page images

文書内で JPEG 画像として取得できるページをページ番号昇順で返します。

stability: stableusage type: 0-credit APIcredits: 0

Parameters

NameInRequiredSchema
document_idpathyesstring

Responses

StatusDescriptionSchemaError codes
200Successful ResponseDocumentPageImagesResponse-
401Authentication failed.ProblemDetails
authentication_requiredinvalid_api_key
403The API key is valid but the account cannot access this API.ProblemDetails
access_not_enabled
404The requested document was not found.ProblemDetails
not_found
422Validation ErrorHTTPValidationError-
429Rate limit or usage limit exceeded.ProblemDetails
quota_exceededrate_limit_exceeded
500Internal server error.ProblemDetails
internal_error
GET/v1/documents/{document_id}/originals

List original files

API から取得できる文書の元ファイルを列挙します。

stability: stableusage type: 0-credit APIcredits: 0

Parameters

NameInRequiredSchema
document_idpathyesstring

Responses

StatusDescriptionSchemaError codes
200Successful ResponseDocumentOriginalsResponse-
401Authentication failed.ProblemDetails
authentication_requiredinvalid_api_key
403The API key is valid but the account cannot access this API.ProblemDetails
access_not_enabled
404The requested document was not found.ProblemDetails
not_found
422Validation ErrorHTTPValidationError-
429Rate limit or usage limit exceeded.ProblemDetails
quota_exceededrate_limit_exceeded
500Internal server error.ProblemDetails
internal_error

Credits

GET/v1/news

List news

一次情報への references[] を持つ news statement を一覧します。timeline_since / timeline_until は news observed_at 基準です。security_codes / macro_tags / timeline_since のいずれかが必須です。next_cursor が null でなければ、同じフィルタに cursor を付けて次ページを取得します。

stability: stableusage type: credit APIcredits: 1

Parameters

NameInRequiredSchema
security_codesquerynostring[] | null
macro_tagsqueryno"Economic Indicators" | "Monetary Policy" | "Fiscal Policy" | "Regulatory Policy" | "Trade & Geopolitical Events" | "Financial Stability" | "External Shocks"[] | null
timeline_sincequerynostring:date | null
timeline_untilquerynostring:date | null
limitquerynointeger
cursorquerynostring | null

Responses

StatusDescriptionSchemaError codes
200Successful ResponseNewsListResponse-
400The news list request is invalid.ProblemDetails
invalid_cursorinvalid_date_rangeinvalid_macro_taginvalid_query_parametermissing_required_filter
401Authentication failed.ProblemDetails
authentication_requiredinvalid_api_key
403The API key is valid but the account cannot access this API.ProblemDetails
access_not_enabled
422Validation ErrorHTTPValidationError-
429Rate limit or usage limit exceeded.ProblemDetails
quota_exceededrate_limit_exceeded
500Internal server error.ProblemDetails
internal_error
GET/v1/documents/{document_id}/content

Get document content

文書本文を content という 1 つの文字列で返します。sections 指定時は sections_returned[] で返却セクションを確認でき、content_sections[] でセクション単位の本文も取得できます。

stability: stableusage type: credit APIcredits: 2/4/8 by character_count

Parameters

NameInRequiredSchema
document_idpathyesstring
sectionsquerynostring[] | null

Responses

StatusDescriptionSchemaError codes
200Successful ResponseDocumentContentResponse-
400The content request is invalid.ProblemDetails
invalid_query_parameterinvalid_section
401Authentication failed.ProblemDetails
authentication_requiredinvalid_api_key
403The API key is valid but the account cannot access this API.ProblemDetails
access_not_enabled
404The requested document was not found.ProblemDetails
not_found
409Document content is not available for delivery.ProblemDetails
content_not_available
422Validation ErrorHTTPValidationError-
429Rate limit or usage limit exceeded.ProblemDetails
quota_exceededrate_limit_exceeded
500Internal server error.ProblemDetails
internal_error
GET/v1/documents/{document_id}/originals/{original_id}

Get original file

元ファイル一覧に含まれるファイルを返します。

stability: stableusage type: credit APIcredits: 8 per file

Parameters

NameInRequiredSchema
document_idpathyesstring
original_idpathyesstring

Responses

StatusDescriptionSchemaError codes
200Original document filestring:binary-
401Authentication failed.ProblemDetails
authentication_requiredinvalid_api_key
403The API key is valid but the account cannot access this API.ProblemDetails
access_not_enabled
404The requested document or original file was not found.ProblemDetails
not_found
409The requested original file cannot be delivered by the API.ProblemDetails
content_not_available
422Validation ErrorHTTPValidationError-
429Rate limit or usage limit exceeded.ProblemDetails
quota_exceededrate_limit_exceeded
500Internal server error.ProblemDetails
internal_error
GET/v1/documents/{document_id}/pages/{page_number}/image

Get page image

指定ページの JPEG 画像を返します。取得可能なページは `GET /v1/documents/{document_id}/page-images` で確認してください。

stability: stableusage type: credit APIcredits: 1 per page

Parameters

NameInRequiredSchema
document_idpathyesstring
page_numberpathyesinteger

Responses

StatusDescriptionSchemaError codes
200JPEG page imagestring:binary-
401Authentication failed.ProblemDetails
authentication_requiredinvalid_api_key
403The API key is valid but the account cannot access this API.ProblemDetails
access_not_enabled
404The requested document or page was not found.ProblemDetails
not_found
409The requested page image is not available for delivery.ProblemDetails
image_not_available
422Validation ErrorHTTPValidationError-
429Rate limit or usage limit exceeded.ProblemDetails
quota_exceededrate_limit_exceeded
500Internal server error.ProblemDetails
internal_error
POST/v1/search/documents

Search documents

文書本文を検索します。semantic 検索では、根拠候補を探す疑問文を使います。document_families は edinet_filing / timely_disclosure のみ指定できます。

stability: stableusage type: credit APIcredits: 1

Request body

FieldRequiredSchemaDefault
queryyesstring-
security_codesnostring[]-
document_typesnostring[]-
timeline_sincenostring:date | null-
timeline_untilnostring:date | null-
match_typeno"semantic" | "lexical"semantic
top_knointeger10
include_snippetnobooleanfalse
document_familiesno"edinet_filing" | "timely_disclosure"[]-

Responses

StatusDescriptionSchemaError codes
200Successful ResponseDocumentSearchResponse-
400The document search request is invalid.ProblemDetails
invalid_date_rangeinvalid_document_familyinvalid_query_parameter
401Authentication failed.ProblemDetails
authentication_requiredinvalid_api_key
403The API key is valid but the account cannot access this API.ProblemDetails
access_not_enabled
422Validation ErrorHTTPValidationError-
429Rate limit or usage limit exceeded.ProblemDetails
quota_exceededrate_limit_exceeded
500Internal server error.ProblemDetails
internal_error
504Search backend did not respond before the request deadline.ProblemDetails
search_backend_timeout
POST/v1/search/news

Search news

news statement を検索します。semantic 検索では、探したい news / event を疑問文で指定します。match_type で semantic / lexical を選べます。macro_tags は public v1 のマクロ事象カテゴリのみ受け付けます。

stability: stableusage type: credit APIcredits: 1

Request body

FieldRequiredSchemaDefault
queryyesstring-
security_codesnostring[]-
macro_tagsno"Economic Indicators" | "Monetary Policy" | "Fiscal Policy" | "Regulatory Policy" | "Trade & Geopolitical Events" | "Financial Stability" | "External Shocks"[]-
timeline_sincenostring:date | null-
timeline_untilnostring:date | null-
match_typeno"semantic" | "lexical"semantic
top_knointeger10

Responses

StatusDescriptionSchemaError codes
200Successful ResponseNewsSearchResponse-
400The news search request is invalid.ProblemDetails
invalid_date_rangeinvalid_macro_taginvalid_query_parameter
401Authentication failed.ProblemDetails
authentication_requiredinvalid_api_key
403The API key is valid but the account cannot access this API.ProblemDetails
access_not_enabled
422Validation ErrorHTTPValidationError-
429Rate limit or usage limit exceeded.ProblemDetails
quota_exceededrate_limit_exceeded
500Internal server error.ProblemDetails
internal_error
504Search backend did not respond before the request deadline.ProblemDetails
search_backend_timeout