224 lines
6.3 KiB
JSON
224 lines
6.3 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.io",
|
|
"email": "filip@lbry.io"
|
|
},
|
|
"description": "Lighthouse is a search engine for the LBRY blockchain based on elasticsearch, chainquery and Node.JS."
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "https://lighthouse.lbry.io"
|
|
}
|
|
],
|
|
"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"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "nsfw",
|
|
"description": "If search should return nsfw content or not.",
|
|
"schema": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "contentType",
|
|
"description": "Filter by MIME type.",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "mediaType",
|
|
"description": "Filter by media type, can be audio, video, image, application, text or cad.",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "claimType",
|
|
"description": "Return channels or files only, value can be 'channel' or 'file'.",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"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"
|
|
}
|
|
]
|
|
}
|