---
title: "Query Parameters - DreamFactory Documentation"
source: "https://wiki.dreamfactory.com/Query_Parameters"
canonical_url: "https://wiki.dreamfactory.com/Query_Parameters"
converted_at: "2026-04-05T06:12:30.444Z"
format: "markdown"
converted_by: "html-to-md-ai"
---
[]()
	
	
	
	# Query Parameters

	
		From DreamFactory Wiki
		
		
		
		
		[Jump to navigation](#mw-head)
		[Jump to search](#searchInput)
		## Contents

- [1 Query Parameters Reference](#Query_Parameters_Reference)

- [1.1 filter](#filter)

- [1.1.1 Operators](#Operators)

- [1.1.2 Combining Filters](#Combining_Filters)

- [1.1.3 Examples](#Examples)

- [1.2 limit](#limit)

- [1.3 offset](#offset)

- [1.4 order](#order)

- [1.5 fields](#fields)

- [1.6 related](#related)

- [1.6.1 Filtering Related Data](#Filtering_Related_Data)

- [1.7 include_count](#include_count)

- [1.8 ids](#ids)

- [1.9 id_field](#id_field)

- [1.10 group](#group)

- [1.11 having](#having)

- [1.12 count_only](#count_only)

- [1.13 Parameter Aliases](#Parameter_Aliases)

- [1.14 Complete Examples](#Complete_Examples)

- [1.14.1 Paginated List with Count](#Paginated_List_with_Count)

- [1.14.2 Filtered Search with Related Data](#Filtered_Search_with_Related_Data)

- [1.14.3 Minimal Payload for Dropdown](#Minimal_Payload_for_Dropdown)

- [1.15 URL Encoding Reference](#URL_Encoding_Reference)

- [1.16 See Also](#See_Also)

# Query Parameters Reference

Common query parameters for filtering, sorting, and paginating DreamFactory API responses.

---

## filter

Filter records using SQL-like expressions.

**Syntax:** `filter={field}{operator}{value}`

### Operators

Operator
Description
Example

`=`
Equal
`filter=status='active'`

`!=`
Not equal
`filter=status!='deleted'`

`>`
Greater than
`filter=age>21`

`>=`
Greater or equal
`filter=created_at>='2024-01-01'`

`<`
Less than
`filter=price<100`

`<=`
Less or equal
`filter=quantity<=10`

`like`
Pattern match
`filter=name like 'John%'`

`in`
Value in list
`filter=status in ('active','pending')`

`is null`
Null check
`filter=deleted_at is null`

`is not null`
Not null check
`filter=email is not null`

### Combining Filters

Use `and` / `or` for compound conditions:

```
filter=(status='active') and (created_at>='2024-01-01')
filter=(type='admin') or (type='superuser')
filter=((status='active') and (age>=18)) or (verified=true)

```

### Examples

**Find active users:**

```
curl "https://example.com/api/v2/db/_table/users?filter=status%3D'active'"

```

**Find orders over $100 from 2024:**

```
curl "https://example.com/api/v2/db/_table/orders?filter=(total>100)%20and%20(order_date>%3D'2024-01-01')"

```

**Search by name pattern:**

```
curl "https://example.com/api/v2/db/_table/contacts?filter=name%20like%20'%25smith%25'"

```

**Note:** URL-encode special characters (`=` as `%3D`, space as `%20`, `%` as `%25`).

---

## limit

Maximum number of records to return.

**Syntax:** `limit={integer}`

**Default:** Configured per-service (typically 1000)

**Examples:**

```
# Get first 10 records
curl "https://example.com/api/v2/db/_table/products?limit=10"

# Get first 50 matching filter
curl "https://example.com/api/v2/db/_table/orders?filter=status='pending'&limit=50"

```

---

## offset

Number of records to skip before returning results.

**Syntax:** `offset={integer}`

**Default:** 0

**Use with `limit` for pagination:**

```
# Page 1 (records 1-10)
curl "https://example.com/api/v2/db/_table/products?limit=10&offset=0"

# Page 2 (records 11-20)
curl "https://example.com/api/v2/db/_table/products?limit=10&offset=10"

# Page 3 (records 21-30)
curl "https://example.com/api/v2/db/_table/products?limit=10&offset=20"

```

**Pagination formula:** `offset = (page - 1) * limit`

---

## order

Sort results by one or more fields.

**Syntax:** `order={field} {direction}` or `order={field1} {dir},{field2} {dir}`

**Directions:** `ASC` (ascending), `DESC` (descending)

**Examples:**

```
# Sort by name ascending
curl "https://example.com/api/v2/db/_table/contacts?order=name%20ASC"

# Sort by date descending (newest first)
curl "https://example.com/api/v2/db/_table/orders?order=created_at%20DESC"

# Multi-column sort
curl "https://example.com/api/v2/db/_table/products?order=category%20ASC,price%20DESC"

```

---

## fields

Select specific fields to return (reduces payload size).

**Syntax:** `fields={field1},{field2},{field3}`

**Examples:**

```
# Return only id, name, email
curl "https://example.com/api/v2/db/_table/users?fields=id,name,email"

# Combine with filter
curl "https://example.com/api/v2/db/_table/orders?filter=status='pending'&fields=id,total,customer_id"

```

**Default:** All fields returned if not specified.

---

## related

Include related records from foreign key relationships.

**Syntax:** `related={table_name}` or `related={table1},{table2}`

**Examples:**

```
# Get orders with customer data
curl "https://example.com/api/v2/db/_table/orders?related=customers"

# Get products with category and supplier
curl "https://example.com/api/v2/db/_table/products?related=categories,suppliers"

```

**Response includes nested related data:**

```
{
  "resource": [
    {
      "id": 1,
      "product_name": "Widget",
      "category_id": 5,
      "categories_by_category_id": {
        "id": 5,
        "name": "Electronics"
      }
    }
  ]
}

```

### Filtering Related Data

Use dot notation to filter on related fields:

```
curl "https://example.com/api/v2/db/_table/orders?related=customers&filter=customers.country='USA'"

```

---

## include_count

Include total record count in response (useful for pagination UI).

**Syntax:** `include_count=true`

**Response includes meta field:**

```
{
  "resource": [...],
  "meta": {
    "count": 1523
  }
}

```

**Example with pagination:**

```
curl "https://example.com/api/v2/db/_table/products?limit=10&offset=0&include_count=true"

```

**Note:** May impact performance on large tables. Use sparingly.

---

## ids

Filter by primary key values (alternative to filter for simple lookups).

**Syntax:** `ids={id1},{id2},{id3}`

**Examples:**

```
# Get specific records by ID
curl "https://example.com/api/v2/db/_table/users?ids=1,5,10,15"

# Delete multiple records
curl -X DELETE "https://example.com/api/v2/db/_table/temp_data?ids=100,101,102"

```

---

## id_field

Specify which field to use as the identifier (when not using default primary key).

**Syntax:** `id_field={field_name}`

**Example:**

```
curl "https://example.com/api/v2/db/_table/products?ids=SKU001,SKU002&id_field=sku"

```

---

## group

Group results by field values (for aggregate queries).

**Syntax:** `group={field}` or `group={field1},{field2}`

**Example:**

```
curl "https://example.com/api/v2/db/_table/orders?group=status&fields=status,count(*)"

```

---

## having

Filter grouped results (use with `group`).

**Syntax:** `having={condition}`

**Example:**

```
curl "https://example.com/api/v2/db/_table/orders?group=customer_id&fields=customer_id,sum(total)&having=sum(total)>1000"

```

---

## count_only

Return only the total record count, not the records themselves.

**Syntax:** `count_only=true`

**Example:**

```
curl "https://example.com/api/v2/db/_table/users?filter=status='active'&count_only=true"

```

**Response:**

```
{
  "meta": {
    "count": 1523
  }
}

```

---

## Parameter Aliases

Some parameters have alternative names for convenience:

Parameter
Aliases

`fields`
`select`

`filter`
`where`

`limit`
`top`

`offset`
`skip`

`order`
`sort`, `order_by`

`group`
`group_by`

---

## Complete Examples

### Paginated List with Count

```
curl "https://example.com/api/v2/db/_table/products\
?limit=20\
&offset=40\
&order=name%20ASC\
&include_count=true\
&fields=id,name,price,stock"

```

### Filtered Search with Related Data

```
curl "https://example.com/api/v2/db/_table/orders\
?filter=(status='pending')%20and%20(total>100)\
&related=customers\
&order=created_at%20DESC\
&limit=50"

```

### Minimal Payload for Dropdown

```
curl "https://example.com/api/v2/db/_table/categories\
?fields=id,name\
&order=name%20ASC\
&filter=active=true"

```

---

## URL Encoding Reference

Character
Encoded

Space
`%20` or `+`

`=`
`%3D`

`'`
`%27`

`%`
`%25`

`&`
`%26`

`(`
`%28`

`)`
`%29`

`,`
`%2C`

**Tip:** Use your HTTP client's built-in URL encoding rather than manual encoding.

---

## See Also

- [API Endpoints](/index.php?title=API_Endpoints&action=edit&redlink=1) - Complete endpoint reference

- [Error Codes](/Error_Codes) - HTTP status codes and error handling

Retrieved from "[https://wiki.dreamfactory.com/index.php?title=Query_Parameters&oldid=851](https://wiki.dreamfactory.com/index.php?title=Query_Parameters&oldid=851)"
		[Category](/Special:Categories): - [API](/Category:API)