Skip to content

Filtering ​

You can narrow down Object List results by applying field filters as query parameters. Filters allow you to retrieve only the objects that match specific criteria.

Field Filters ​

Filter by exact field values by passing the field name and desired value as a query parameter:

?status_name=Connected
?is_oneoff=true

For example, to retrieve only measurements with status 2 (Specified):

GET /api/v2/measurements/?status=2
Try it out

Range Filters ​

For numeric and date fields, you can use lookup suffixes to filter by ranges:

SuffixDescriptionExample
__gtGreater thanid__gt=1000
__gteGreater than or equal toid__gte=1000
__ltLess thanid__lt=2000
__lteLess than or equal toid__lte=2000
__inMatches any value in a comma-separated listasn_v4__in=3333,1234

For example, to retrieve objects with IDs between 1000 and 2000:

?id__gte=1000&id__lte=2000

String Filters ​

For text fields, additional lookup suffixes are available:

SuffixDescriptionExample
__containsField contains the given substringdescription__contains=test
__startswithField starts with the given stringdescription__startswith=DNS
__endswithField ends with the given stringdescription__endswith=anchor

Combining Filters ​

When you specify multiple filter parameters, they are combined with AND logic. All conditions must be true for an object to be included in the results:

?status=2&is_oneoff=true&protocol=4

This returns only measurements that are status 2 and one-off and using IPv4.

Silent Ignore ​

Like other query parameters, unknown filter parameters are silently ignored by the API. If a filter does not seem to be working, verify that the field name and suffix are correct for the resource type you are querying.