121 lines
3.1 KiB
JSON
121 lines
3.1 KiB
JSON
{
|
|
"components": {
|
|
"securitySchemes": {
|
|
"googleApiKey": {
|
|
"type": "apiKey",
|
|
"name": "key",
|
|
"in": "query",
|
|
"description": "API key for Google Custom Search API"
|
|
},
|
|
"customSearchId": {
|
|
"type": "apiKey",
|
|
"name": "cx",
|
|
"in": "query",
|
|
"description": "The custom search engine ID to use for this request"
|
|
}
|
|
}
|
|
},
|
|
"info": {
|
|
"title": "Web Search",
|
|
"version": "1.0.0"
|
|
},
|
|
"openapi": "3.0.0",
|
|
"paths": {
|
|
"/customsearch/v1": {
|
|
"get": {
|
|
"summary": "Search Google using Custom Search API",
|
|
"operationId": "searchGoogle",
|
|
"parameters": [
|
|
{
|
|
"in": "query",
|
|
"name": "q",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"required": true,
|
|
"description": "Search query string"
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "num",
|
|
"schema": {
|
|
"type": "integer",
|
|
"default": 10
|
|
},
|
|
"required": false,
|
|
"description": "Number of search results to return (1-10)"
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "gl",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"required": false,
|
|
"description": "Geolocation of end user (country code)"
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "hl",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"required": false,
|
|
"description": "Interface language"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful search results",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"items": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"title": {
|
|
"type": "string",
|
|
"description": "The title of the search result"
|
|
},
|
|
"link": {
|
|
"type": "string",
|
|
"description": "The URL of the search result"
|
|
},
|
|
"snippet": {
|
|
"type": "string",
|
|
"description": "A snippet of text from the search result"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"googleApiKey": [],
|
|
"customSearchId": []
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"googleApiKey": [],
|
|
"customSearchId": []
|
|
}
|
|
],
|
|
"servers": [
|
|
{
|
|
"url": "https://www.googleapis.com"
|
|
}
|
|
]
|
|
} |