lighthouse.js/swagger.json
2019-07-08 20:00:10 +02:00

192 lines
5.4 KiB
JSON

{
"openapi": "3.0.0",
"x-api-id": "lighthouse",
"info": {
"version": "0.0.1",
"title": "Lighthouse",
"license": {
"name": "MIT",
"url": "https://raw.githubusercontent.com/lbryio/lighthouse/master/LICENSE"
},
"contact": {
"name": "LBRY Inc",
"url": "https://lbry.com",
"email": "filip@lbry.com"
},
"description": "Lighthouse is a search engine for the LBRY blockchain based on elasticsearch, chainquery and Node.JS."
},
"servers": [
{
"url": "https://lighthouse.lbry.com"
}
],
"paths": {
"/search": {
"get": {
"description": "Returns all the searches matching the search query.",
"tags": [
"Search API"
],
"parameters": [
{
"in": "query",
"name": "s",
"required": true,
"description": "The search text",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "channel",
"description": "The channel to search, if none, will return all search results",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "size",
"description": "The amount of results to return at max",
"schema": {
"type": "integer"
}
},
{
"in": "query",
"name": "from",
"description": "The number to start from, good for pagination",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "The search API returns an array of the found matching search items.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"claimId"
],
"properties": {
"name": {
"type": "integer",
"description": "The name of the claim.",
"example": "LBRY"
},
"claimId": {
"type": "string",
"description": "The claimId of the claim.",
"example": "3db81c073f82fd1bb670c65f526faea3b8546720"
},
"value": {
"type": "object",
"description": "Here is the decoded claimdata/metadata from the claim in an object."
}
}
}
}
}
}
}
}
}
},
"/autocomplete": {
"get": {
"tags": [
"Autocomplete API"
],
"description": "Returns an array of autocompleted strings.",
"parameters": [
{
"in": "query",
"name": "s",
"required": true,
"description": "The string to be autocompleted.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "The autocomplete API returns an array of the found matching autocompleted strings.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "string",
"description": "A autocompleted string",
"example": "lbryisawesome"
}
}
}
}
}
}
}
},
"/status": {
"get": {
"tags": [
"Status API"
],
"description": "Returns the current status of the lighthouse instance.",
"responses": {
"200": {
"description": "Returns the current status of the lighthouse instance.",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"spaceUsed",
"claimsInIndex",
"totSearches"
],
"properties": {
"spaceUsed": {
"type": "string",
"description": "The size of the elasticsearch database.",
"example": "632.3MB"
},
"claimsInIndex": {
"type": "integer",
"description": "The amount of claims in the search index.",
"example": 97615085
},
"totSearches": {
"type": "integer",
"description": "The amount of searches since the start of the lighthouse instance.",
"example": 100000
}
}
}
}
}
}
}
}
}
},
"tags": [
{
"name": "Search API"
},
{
"name": "Autocomplete API"
},
{
"name": "Status API"
}
]
}