For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://api-doc-new.gideononline.com/gideon-api-1-0/search/llms.txt. For full documentation content, see https://api-doc-new.gideononline.com/gideon-api-1-0/search/llms-full.txt.

# /query

POST https://api.gideononline.com/query
Content-Type: application/json

Runs a **keyword search** against GIDEON content. The API returns `{ "data": ... }` where `data` is the search payload from the search service (shape may include hits, facets, and metadata depending on the query).

#### **Request body (JSON)**

| Field | Required | Description |
| --- | --- | --- |
| `query` | **Yes** | Search text. |
| `offset` | No | Starting offset for paginated results. |
| `limit` | No | Page size. |
| `module_filter` | No | Narrow results by module (e.g. diseases). |
| `record_type_filter` | No | Narrow by record type (e.g. graph, image). |

#### **Errors**

- **400** — Body is not valid JSON or `query` is missing/empty.
- **503** — Search service is not configured on the server.
- **502** — Search service could not be reached or returned an error.

Non-success responses may use `{ "error": { "message", "status" } }`.

Reference: https://api-doc-new.gideononline.com/gideon-api-1-0/search/query

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /query:
    post:
      operationId: query
      summary: /query
      description: >-
        Runs a **keyword search** against GIDEON content. The API returns `{
        "data": ... }` where `data` is the search payload from the search
        service (shape may include hits, facets, and metadata depending on the
        query).


        #### **Request body (JSON)**


        | Field | Required | Description |

        | --- | --- | --- |

        | `query` | **Yes** | Search text. |

        | `offset` | No | Starting offset for paginated results. |

        | `limit` | No | Page size. |

        | `module_filter` | No | Narrow results by module (e.g. diseases). |

        | `record_type_filter` | No | Narrow by record type (e.g. graph, image).
        |


        #### **Errors**


        - **400** — Body is not valid JSON or `query` is missing/empty.

        - **503** — Search service is not configured on the server.

        - **502** — Search service could not be reached or returned an error.


        Non-success responses may use `{ "error": { "message", "status" } }`.
      tags:
        - subpackage_search
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Search_/query_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                query:
                  type: string
                offset:
                  type: integer
                module_filter:
                  type: string
                record_type_filter:
                  type: string
              required:
                - limit
                - query
                - offset
                - module_filter
                - record_type_filter
servers:
  - url: https://api.gideononline.com
  - url: https://api-test.gideononline.com
components:
  schemas:
    QueryPostResponsesContentApplicationJsonSchemaDataFacets:
      type: object
      properties: {}
      title: QueryPostResponsesContentApplicationJsonSchemaDataFacets
    QueryPostResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        hits:
          type: array
          items:
            description: Any type
        facets:
          $ref: >-
            #/components/schemas/QueryPostResponsesContentApplicationJsonSchemaDataFacets
      required:
        - hits
        - facets
      title: QueryPostResponsesContentApplicationJsonSchemaData
    Search_/query_Response_200:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/QueryPostResponsesContentApplicationJsonSchemaData
      required:
        - data
      title: Search_/query_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

```

## SDK Code Examples

```python Search_/query_example
import requests

url = "https://api.gideononline.com/query"

payload = {
    "limit": 10,
    "query": "dengue",
    "offset": 0,
    "module_filter": "diseases",
    "record_type_filter": "graph"
}
headers = {
    "Authorization": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Search_/query_example
const url = 'https://api.gideononline.com/query';
const options = {
  method: 'POST',
  headers: {Authorization: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"limit":10,"query":"dengue","offset":0,"module_filter":"diseases","record_type_filter":"graph"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Search_/query_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.gideononline.com/query"

	payload := strings.NewReader("{\n  \"limit\": 10,\n  \"query\": \"dengue\",\n  \"offset\": 0,\n  \"module_filter\": \"diseases\",\n  \"record_type_filter\": \"graph\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Search_/query_example
require 'uri'
require 'net/http'

url = URI("https://api.gideononline.com/query")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"limit\": 10,\n  \"query\": \"dengue\",\n  \"offset\": 0,\n  \"module_filter\": \"diseases\",\n  \"record_type_filter\": \"graph\"\n}"

response = http.request(request)
puts response.read_body
```

```java Search_/query_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.gideononline.com/query")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"limit\": 10,\n  \"query\": \"dengue\",\n  \"offset\": 0,\n  \"module_filter\": \"diseases\",\n  \"record_type_filter\": \"graph\"\n}")
  .asString();
```

```php Search_/query_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.gideononline.com/query', [
  'body' => '{
  "limit": 10,
  "query": "dengue",
  "offset": 0,
  "module_filter": "diseases",
  "record_type_filter": "graph"
}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Search_/query_example
using RestSharp;

var client = new RestClient("https://api.gideononline.com/query");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"limit\": 10,\n  \"query\": \"dengue\",\n  \"offset\": 0,\n  \"module_filter\": \"diseases\",\n  \"record_type_filter\": \"graph\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Search_/query_example
import Foundation

let headers = [
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "limit": 10,
  "query": "dengue",
  "offset": 0,
  "module_filter": "diseases",
  "record_type_filter": "graph"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.gideononline.com/query")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```