All Products
Search
Document Center

IoT Platform:Advanced search

Last Updated:Jun 16, 2026

Use SQL-like statements to search for devices that meet specific criteria, such as online devices, and download a list of matching devices that includes their ProductKey and DeviceName.

Limitations

  • Supported regions: China (Shanghai), , and Japan (Tokyo).

  • Feature limitations: The Advanced Search feature is not supported on the Devices > Device page for public instances.

Use cases

You can use advanced search in the following scenarios in the IoT Platform console:

  • View device information: On the Advanced Search tab of the Devices > Device page, search for and manage specific devices.

You can also call the QueryDeviceBySQL API operation to perform an advanced search. The API is not limited to these console scenarios.

Procedure

The following examples show how to use advanced search in the IoT Platform console to add devices to a device group and to search for devices by TSL model.

  1. Log on to the IoT Platform console.

  2. On the Overview page, find the instance that you want to manage and click the instance ID or instance name.

  3. In the navigation pane on the left, choose Devices > Device, and then click the Advanced Search tab.

  4. On the Advanced Search tab, search for devices that meet your criteria.

    高级搜索

SQL-like syntax

When you use advanced search in the console, an SQL-like statement consists of a WHERE clause and an optional ORDER BY clause. The SELECT and LIMIT clauses, and the WHERE keyword itself, are omitted. Statements are limited to 400 characters.

Example:

product_key = "a1*****" order by active_time

WHERE clause

Format:

[condition1] AND [condition2] 

Omit WHERE.

You can specify a maximum of five conditions. Nested conditions are not supported.

The AND and OR logical operators are supported. You can use a maximum of five logical operators per statement.

ORDER BY clause (optional)

Use the ORDER BY clause to sort results. You can sort by the gmt_create, gmt_modified, and active_time fields.

This clause is optional. If omitted, results are returned in a random order.

Searchable fields

Field

Type

Description

product_key

text

The ProductKey of the product to which the device belongs.

iot_id

text

The device identifier. The iot_id field is returned by default.

name

text

The DeviceName of the device.

active_time

date

The time when the device was activated. The time is in the yyyy-MM-dd HH:mm:ss.SSS format, accurate to the millisecond.

nickname

text

The alias of the device.

gmt_create

date

The time when the device was created. The time is in the yyyy-MM-dd HH:mm:ss.SSS format, accurate to the millisecond.

gmt_modified

date

The time when the device's nickname was last updated. The time is in the yyyy-MM-dd HH:mm:ss.SSS format, accurate to the millisecond.

status

text

The status of the device. Valid values:

  • ONLINE: The device is online.

  • OFFLINE: The device is offline.

  • UNACTIVE: The device is not activated.

  • DISABLE: The device is disabled.

group.group_id

text

The ID of the device group.

tag.tag_name

text

The tag key.

tag.tag_value

text

The tag value.

ota_module.name

text

The name of the OTA module.

Use this field with ota_module.version to specify the OTA module that corresponds to the device's current OTA version.

ota_module.version

text

The current OTA version of the device.

Use this field with ota_module.name.

Operators

Operator

Supported field types

=

number, date, text, keyword

>

number, date

<

number, date

LIKE

text

The LIKE operator supports prefix matching but does not support suffix or wildcard matching. The prefix must meet the following conditions:

  • The prefix must contain at least four characters and cannot contain any special characters, such as backslashes (\), forward slashes (/), ampersands (&), plus signs (+), hyphens (-), exclamation points (!), parentheses (), colons (:), tildes (~), square brackets ([]), curly brackets ({}), asterisks (*), and question marks (?).

  • The prefix must end with %.

Example:

product_key = "a1*********" and name LIKE "test%"

Related API

QueryDeviceBySQL: searches for devices that meet specified conditions by using SQL-like statements.