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/diseases/llms.txt. For full documentation content, see https://api-doc-new.gideononline.com/gideon-api-1-0/diseases/llms-full.txt.

# /diseases/surveys/filter

GET https://api.gideononline.com/diseases/surveys/filter

Returns **prevalence and seroprevalence survey** rows matching optional filters. Results are ordered by the greater of survey start year and publication year (newest first).

Each row includes core survey fields, resolved **`pathogens`** and **`test_types`** name arrays (underlying id lists are not returned), and a top-level **`timestamp`** (Unix epoch seconds) reflecting the most recent row update in the filtered set.

If the filter set matches **more than** the server limit (see `max_records` in the capped response; default **500** when no setting override), the API returns **HTTP 200** with `{ "data": { "record_count", "max_records" } }` instead of the full list—add filters (for example `disease` and `country`) and call again.

Use **`GET /diseases/surveys/filter-options`** to discover available filter values for the current dataset.

#### **Query parameters**

| Name | Required | Description |
| --- | --- | --- |
| `disease` | No | Numeric GIDEON disease identifier. |
| `country` | No | GIDEON country code. |
| `survey_start_year` | No | Lower bound on survey start year. |
| `survey_end_year` | No | Upper bound on end year; uses end year when present, otherwise start year. |
| `test_type` | No | Substring match on test-type labels. |
| `pathogen` | No | Substring match on pathogen labels. |
| `percentRange` | No | Filter on primary percentage: operators `<`, `>`, `<=`, `>=` plus a number (e.g. `>=10`), or a plain number (treated as **>=** that value). |
| `population` | No | Survey population group id (values from filter-options). |
| `region` | No | Subdivision (state or equivalent) code from filter-options when available. |
| `type` | No | `Prevalence` or `Seroprevalence` (exact spelling). |
| `size` | No | Survey size bucket: `min-max` (e.g. `0-500`, `500-1000`) or `threshold+` (e.g. `500000+`). |

#### **Success with rows**

`{ "data": [ ... ], "timestamp": <unix_epoch_seconds> }` — each survey object uses **lowercase** keys (e.g. `id` prefixed with `s_`, `survey_start`, `survey_end`, `publication_year`, `region`, `population`, `percent1`, `percent2`, `surveysize`, `disease_id`, `hash_id`, `disease_name`, `country_code`, `country_name`, `last_update_date`, `survey_type`, `pathogens`, `test_types`). Top-level `timestamp` is a Unix epoch integer (seconds), not an ISO string. The Postman example shows **one** `data` row for brevity.

#### **Too many matches**

`{ "data": { "record_count": <n>, "max_records": <cap> } }` with **200**.

#### **Errors**

- **500** — Invalid request (generic error body).

Reference: https://api-doc-new.gideononline.com/gideon-api-1-0/diseases/diseases-surveys-filter

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /diseases/surveys/filter:
    get:
      operationId: diseases-surveys-filter
      summary: /diseases/surveys/filter
      description: >-
        Returns **prevalence and seroprevalence survey** rows matching optional
        filters. Results are ordered by the greater of survey start year and
        publication year (newest first).


        Each row includes core survey fields, resolved **`pathogens`** and
        **`test_types`** name arrays (underlying id lists are not returned), and
        a top-level **`timestamp`** (Unix epoch seconds) reflecting the most
        recent row update in the filtered set.


        If the filter set matches **more than** the server limit (see
        `max_records` in the capped response; default **500** when no setting
        override), the API returns **HTTP 200** with `{ "data": {
        "record_count", "max_records" } }` instead of the full list—add filters
        (for example `disease` and `country`) and call again.


        Use **`GET /diseases/surveys/filter-options`** to discover available
        filter values for the current dataset.


        #### **Query parameters**


        | Name | Required | Description |

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

        | `disease` | No | Numeric GIDEON disease identifier. |

        | `country` | No | GIDEON country code. |

        | `survey_start_year` | No | Lower bound on survey start year. |

        | `survey_end_year` | No | Upper bound on end year; uses end year when
        present, otherwise start year. |

        | `test_type` | No | Substring match on test-type labels. |

        | `pathogen` | No | Substring match on pathogen labels. |

        | `percentRange` | No | Filter on primary percentage: operators `<`,
        `>`, `<=`, `>=` plus a number (e.g. `>=10`), or a plain number (treated
        as **>=** that value). |

        | `population` | No | Survey population group id (values from
        filter-options). |

        | `region` | No | Subdivision (state or equivalent) code from
        filter-options when available. |

        | `type` | No | `Prevalence` or `Seroprevalence` (exact spelling). |

        | `size` | No | Survey size bucket: `min-max` (e.g. `0-500`, `500-1000`)
        or `threshold+` (e.g. `500000+`). |


        #### **Success with rows**


        `{ "data": [ ... ], "timestamp": <unix_epoch_seconds> }` — each survey
        object uses **lowercase** keys (e.g. `id` prefixed with `s_`,
        `survey_start`, `survey_end`, `publication_year`, `region`,
        `population`, `percent1`, `percent2`, `surveysize`, `disease_id`,
        `hash_id`, `disease_name`, `country_code`, `country_name`,
        `last_update_date`, `survey_type`, `pathogens`, `test_types`). Top-level
        `timestamp` is a Unix epoch integer (seconds), not an ISO string. The
        Postman example shows **one** `data` row for brevity.


        #### **Too many matches**


        `{ "data": { "record_count": <n>, "max_records": <cap> } }` with
        **200**.


        #### **Errors**


        - **500** — Invalid request (generic error body).
      tags:
        - subpackage_diseases
      parameters:
        - name: disease
          in: query
          description: Numeric GIDEON disease identifier.
          required: false
          schema:
            type: integer
        - name: country
          in: query
          description: GIDEON country code.
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: Prevalence or Seroprevalence
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Diseases_/diseases/surveys/filter_Response_200
servers:
  - url: https://api.gideononline.com
  - url: https://api-test.gideononline.com
components:
  schemas:
    DiseasesSurveysFilterGetResponsesContentApplicationJsonSchemaDataItems:
      type: object
      properties:
        id:
          type: string
        region:
          type: string
        hash_id:
          type: string
          format: uuid
        percent1:
          type: number
          format: double
        percent2:
          description: Any type
        pathogens:
          type: array
          items:
            description: Any type
        disease_id:
          type: integer
        population:
          type: string
        survey_end:
          type: integer
        surveysize:
          type: integer
        test_types:
          type: array
          items:
            description: Any type
        survey_type:
          type: string
        country_code:
          type: string
        country_name:
          type: string
        disease_name:
          type: string
        survey_start:
          type: integer
        last_update_date:
          type: string
        publication_year:
          description: Any type
      required:
        - id
        - region
        - hash_id
        - percent1
        - pathogens
        - disease_id
        - population
        - survey_end
        - surveysize
        - test_types
        - survey_type
        - country_code
        - country_name
        - disease_name
        - survey_start
        - last_update_date
      title: DiseasesSurveysFilterGetResponsesContentApplicationJsonSchemaDataItems
    Diseases_/diseases/surveys/filter_Response_200:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: >-
              #/components/schemas/DiseasesSurveysFilterGetResponsesContentApplicationJsonSchemaDataItems
        timestamp:
          type: integer
      required:
        - data
        - timestamp
      title: Diseases_/diseases/surveys/filter_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

```

## SDK Code Examples

```python Diseases_/diseases/surveys/filter_example
import requests

url = "https://api.gideononline.com/diseases/surveys/filter"

querystring = {"disease":"10040","country":"G292","type":"Prevalence"}

headers = {"Authorization": "<apiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Diseases_/diseases/surveys/filter_example
const url = 'https://api.gideononline.com/diseases/surveys/filter?disease=10040&country=G292&type=Prevalence';
const options = {method: 'GET', headers: {Authorization: '<apiKey>'}};

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

```go Diseases_/diseases/surveys/filter_example
package main

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

func main() {

	url := "https://api.gideononline.com/diseases/surveys/filter?disease=10040&country=G292&type=Prevalence"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "<apiKey>")

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

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

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

}
```

```ruby Diseases_/diseases/surveys/filter_example
require 'uri'
require 'net/http'

url = URI("https://api.gideononline.com/diseases/surveys/filter?disease=10040&country=G292&type=Prevalence")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<apiKey>'

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

```java Diseases_/diseases/surveys/filter_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.gideononline.com/diseases/surveys/filter?disease=10040&country=G292&type=Prevalence")
  .header("Authorization", "<apiKey>")
  .asString();
```

```php Diseases_/diseases/surveys/filter_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.gideononline.com/diseases/surveys/filter?disease=10040&country=G292&type=Prevalence', [
  'headers' => [
    'Authorization' => '<apiKey>',
  ],
]);

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

```csharp Diseases_/diseases/surveys/filter_example
using RestSharp;

var client = new RestClient("https://api.gideononline.com/diseases/surveys/filter?disease=10040&country=G292&type=Prevalence");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Diseases_/diseases/surveys/filter_example
import Foundation

let headers = ["Authorization": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.gideononline.com/diseases/surveys/filter?disease=10040&country=G292&type=Prevalence")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```