{ "openapi": "3.0.0", "info": { "title": "Antelope Transactions Api", "summary": "Transactions information from the Antelope blockchains, powered by Substreams", "license": { "name": "MIT", "url": "https://github.com/pinax-network/antelope-transactions-api/blob/75db1c61477ac7ea5e56f775cefe54875af953d4/LICENSE" }, "version": "0.1.0" }, "tags": [ { "name": "Usage" }, { "name": "Docs" }, { "name": "Monitoring" } ], "paths": { "/blocks/{date}": { "get": { "tags": [ "Usage" ], "operationId": "Usage_blocksDate", "summary": "Blocks", "description": "Block by date.", "parameters": [ { "name": "date", "in": "path", "required": true, "schema": { "type": "string", "format": "date" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 10 } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 1 } } ], "responses": { "200": { "description": "Array of blocks.", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "meta" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Models.Blocks" } }, "meta": { "$ref": "#/components/schemas/ResponseMetadata" } } } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/blocks/{hash}": { "get": { "tags": [ "Usage" ], "operationId": "Usage_blocksHash", "summary": "Blocks", "description": "Block by hash.", "parameters": [ { "name": "hash", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 10 } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 1 } } ], "responses": { "200": { "description": "Array of blocks.", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "meta" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Models.Blocks" } }, "meta": { "$ref": "#/components/schemas/ResponseMetadata" } } } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/blocks/{number}": { "get": { "tags": [ "Usage" ], "operationId": "Usage_blocksNumber", "summary": "Blocks", "description": "Block by number.", "parameters": [ { "name": "number", "in": "path", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 10 } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 1 } } ], "responses": { "200": { "description": "Array of blocks.", "content": { "application/json": { "schema": { "type": "object", "required": [ "data", "meta" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Models.Blocks" } }, "meta": { "$ref": "#/components/schemas/ResponseMetadata" } } } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/health": { "get": { "tags": [ "Monitoring" ], "operationId": "Monitoring_health", "summary": "Health check", "description": "Checks database connection.", "parameters": [], "responses": { "200": { "description": "OK or ApiError.", "content": { "application/json": { "schema": { "type": "string" } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } } } }, "/metrics": { "get": { "tags": [ "Monitoring" ], "operationId": "Monitoring_metrics", "summary": "Prometheus metrics", "description": "Prometheus metrics.", "parameters": [], "responses": { "200": { "description": "Metrics as text.", "content": { "application/json": { "schema": { "type": "string" } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } } } }, "/openapi": { "get": { "tags": [ "Docs" ], "operationId": "Docs_openapi", "summary": "OpenAPI JSON spec", "description": "Reflection endpoint to return OpenAPI JSON spec. Also used by Swagger to generate the frontpage.", "parameters": [], "responses": { "200": { "description": "The OpenAPI JSON spec", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {} } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } } } }, "/version": { "get": { "tags": [ "Docs" ], "operationId": "Docs_version", "summary": "Api version", "description": "Api version and Git short commit hash.", "parameters": [], "responses": { "200": { "description": "The Api version and commit hash.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Version" } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } } } } }, "components": { "schemas": { "ApiError": { "type": "object", "required": [ "status", "code", "message" ], "properties": { "status": { "type": "number", "enum": [ 500, 504, 400, 401, 403, 404, 405 ] }, "code": { "type": "string", "enum": [ "bad_database_response", "bad_header", "missing_required_header", "bad_query_input", "database_timeout", "forbidden", "internal_server_error", "method_not_allowed", "route_not_found", "unauthorized" ] }, "message": { "type": "string" } } }, "Models.Blocks": { "type": "object", "required": [ "block_time", "block_number", "block_hash", "block_date", "parent_hash", "producer", "confirmed", "schedule_version", "version", "producer_signature", "dpos_proposed_irreversible_blocknum", "dpos_irreversible_blocknum", "transaction_mroot", "action_mroot", "blockroot_merkle_node_count", "size", "total_transactions", "successful_transactions", "failed_transactions", "total_actions", "total_db_ops" ], "properties": { "block_time": { "type": "string", "format": "date-time" }, "block_number": { "type": "integer", "format": "uint64" }, "block_hash": { "type": "string" }, "block_date": { "type": "string", "format": "date" }, "parent_hash": { "type": "string" }, "producer": { "type": "string" }, "confirmed": { "type": "integer", "format": "uint32" }, "schedule_version": { "type": "integer", "format": "uint32" }, "version": { "type": "integer", "format": "uint32" }, "producer_signature": { "type": "string" }, "dpos_proposed_irreversible_blocknum": { "type": "integer", "format": "uint32" }, "dpos_irreversible_blocknum": { "type": "integer", "format": "uint32" }, "transaction_mroot": { "type": "string" }, "action_mroot": { "type": "string" }, "blockroot_merkle_node_count": { "type": "integer", "format": "uint32" }, "size": { "type": "integer", "format": "uint64" }, "total_transactions": { "type": "integer", "format": "uint64" }, "successful_transactions": { "type": "integer", "format": "uint64" }, "failed_transactions": { "type": "integer", "format": "uint64" }, "total_actions": { "type": "integer", "format": "uint64" }, "total_db_ops": { "type": "integer", "format": "uint64" } } }, "Pagination": { "type": "object", "required": [ "next_page", "previous_page", "total_pages", "total_results" ], "properties": { "next_page": { "type": "integer", "format": "int64" }, "previous_page": { "type": "integer", "format": "int64" }, "total_pages": { "type": "integer", "format": "int64" }, "total_results": { "type": "integer", "format": "int64" } } }, "QueryStatistics": { "type": "object", "required": [ "elapsed", "rows_read", "bytes_read" ], "properties": { "elapsed": { "type": "number" }, "rows_read": { "type": "integer", "format": "int64" }, "bytes_read": { "type": "integer", "format": "int64" } } }, "ResponseMetadata": { "type": "object", "required": [ "statistics", "next_page", "previous_page", "total_pages", "total_results" ], "properties": { "statistics": { "type": "object", "allOf": [ { "$ref": "#/components/schemas/QueryStatistics" } ], "nullable": true }, "next_page": { "type": "integer", "format": "int64" }, "previous_page": { "type": "integer", "format": "int64" }, "total_pages": { "type": "integer", "format": "int64" }, "total_results": { "type": "integer", "format": "int64" } } }, "Version": { "type": "object", "required": [ "version", "commit" ], "properties": { "version": { "type": "string", "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$" }, "commit": { "type": "string", "pattern": "^[0-9a-f]{7}$" } } } }, "securitySchemes": { "ApiKeyAuth": { "type": "apiKey", "in": "header", "name": "X-Api-Key" } } } }