--- swagger: "2.0" info: description: "The LBRY blockchain is read into SQL where important structured information\ \ can be extracted through the Chain Query API." version: "0.1.0" title: "Chain Query" host: "0.0.0.0:6300" basePath: "/api" tags: - name: "stat" description: "Operations that describe the status of ChainQuery" - name: "query" description: "Operations dealing with raw queries to the chainquery database." schemes: - "http" - "https" consumes: - "application/json" produces: - "application/json" paths: /status: get: tags: - "stat" summary: "Returns important status information about Chain Query" operationId: "ChainQueryStatus" schemes: - "http" consumes: - "application/json" produces: - "application/json" parameters: [] responses: 200: description: "Chain Query status" schema: $ref: "#/definitions/TableStatus" x-oad-type: "response" x-oad-type: "operation" /addresssummary: get: tags: - "stat" summary: "Returns a summary of Address activity" description: "It returns sent, recieved, balance, and number of transactions\ \ it has been used in." operationId: "AddressSummary" schemes: - "http" consumes: - "application/json" produces: - "application/json" parameters: - name: "LbryAddress" in: "query" description: "A LbryAddress" required: true type: "string" x-oad-type: "parameter" x-exportParamName: "LbryAddress" responses: 200: description: "It returns sent, recieved, balance, and number of transactions\ \ it has been used in." schema: $ref: "#/definitions/AddressSummary" x-oad-type: "response" x-oad-type: "operation" /sql: get: tags: - "query" summary: "Use SQL in a RESTful way" description: "API exposed for sending SQL queries directly against the chainquery\ \ database. Since this is an exposed API there are limits to its use. These\ \ limits include queries per hour, read-only, limited to 60 second timeout. " operationId: "SQL Query" parameters: - name: "query" in: "path" description: "The SQL query to be put against the chainquery database." required: true type: "string" x-oad-type: "parameter" x-exportParamName: "Query" - name: "values" in: "path" description: "when passing in a query use '?' for values which will be replaced\ \ in order of appearance with this array." required: true type: "array" items: type: "string" collectionFormat: "csv" x-oad-type: "parameter" x-exportParamName: "Values" responses: 200: description: "It will return the rows as a json array." schema: type: "array" items: type: "object" description: "object with fields representing the selected columns of\ \ the query." title: "Row object" properties: {} x-oad-type: "object" x-oad-type: "array" x-oad-type: "response" 400: description: "This is returned when the sql query has failed, either due\ \ to syntax issues with the query, nameing, priviledges etc. An error\ \ is provided with the response." schema: type: "string" description: "what went wrong?" title: "error message" x-oad-type: "string" x-oad-type: "response" x-oad-type: "operation" definitions: TableSize: type: "object" properties: TableName: type: "string" description: "Name of the table being referenced." title: "Table Name" x-oad-type: "string" NrRows: type: "integer" format: "int64" description: "The number of rows in the referenced table" title: "Number of Rows" x-oad-type: "integer" title: "Table Size " description: "Contains the name and number of rows for a table." example: TableName: "TableName" NrRows: 0 x-oad-type: "object" TableStatus: type: "object" properties: Status: type: "array" title: "Array of Tables" uniqueItems: true items: $ref: "#/definitions/TableSize" x-oad-type: "array" title: "Table status of Chain Query" description: "Contains an array of tables and their row count." example: Status: - TableName: "TableName" NrRows: 0 - TableName: "TableName" NrRows: 0 x-oad-type: "object" AddressSummary: type: "object" properties: Address: type: "string" title: "LBRY Address" x-oad-type: "string" TotalReceived: type: "number" format: "double" description: "Total amount received by address from all transactions it was\ \ a part of." title: " Total Recieved" default: 0.0 x-oad-type: "number" TotalSent: type: "number" format: "double" description: "Total amount sent from address for all transactions it was a\ \ part of." title: "Total Sent" default: 0.0 x-oad-type: "number" Balance: type: "number" format: "double" description: "The current balance of an address" title: "Balance" default: 0.0 x-oad-type: "number" title: "Contains information about an address" example: Address: "Address" TotalSent: 6.027456183070403 TotalReceived: 0.8008281904610115 Balance: 1.4658129805029452 x-oad-type: "object" parameters: address: name: "LbryAddress" in: "query" description: "A LbryAddress" required: true type: "string" x-oad-type: "parameter" x-exportParamName: "LbryAddress"