Global Search
This search API is the backend for the Advanced Search UI in the Performance tab. In BlazeMeter's microservice architecture, each service owns its own data, and there are relationships between entities from different services. This endpoint provides a straightforward way to run search queries against the whole data model.
Search Globally
API Explorer: /search
Use this endpoint to search for entities such as accounts, workspaces, projects, users, tests, tags, and locations.
To receive the most recent information which entities and fields are supported in the search, make a GET call to the Search Metadata endpoint: GET https://a.blazemeter.com/api/v4/search/metadata to download search-metadata.json. This file covers the list of searchable entities, their fields, and relationships:
- Fields - For fields, it lists the type of field, and its "features". Features include "orderable" if the field is orderable.
- Root Entities - The Metadata flag “searchRoot“ is a Boolean that indicates whether the entity is searchable as root entity. For example, the "user" and "location" entities are not searchable as root; they can only be searched indirectly through tests or masters.
- Relationships - Which entities the entity is related to, the cardinality, and "features". Features include "ordering" (if we can order by fields of the related entity) and "filtering" (if we can filter by fields of the related entity).
- The list of types - Which operators are available for each data type.
Search Request Attributes
Attributes
-
entity
stringrequired
Defines the root entity to search for. Choose one of the following options:
"account"
"workspace"
"master"
"project"
"tag"
"test-union"
mdash; includes both tests and multi-tests
-
accountId
stringoptional
Specifies a search filter for either a single accountId (for example, 123 or [123]), a list of accountIds (for example, [123,456]), or use null to include all accountIds. Specifying [] results in an empty result set.
Some entities are not directly associated with an accountId, for example, a test entity is linked to a project, a project is linked to an organization, and an organization is linked to an account.
-
workspaceId
stringoptional
Specifies a search filter for a single workspaceId (for example, 123 or [123]) or a list of workspaceIds (for example, [123,456]). Specifying [] results in an empty result set.
-
fields
stringoptional
Defines the list of fields that you want to return from the root entity and related entities.
null
or[]
- Returns all root entity fields, including test name, test id, test type, and so on. Does not include second level fields, such as user name, last-updated-by email, project name, and so on. This is the default."fieldname"
- Defines the name of the specific field that you want to return from the root entity, such as name, id, or type."*"
- Returns all root entity fields."relationship.*"
or"relationship.attribute"
- Returns all root fields with the specific relationship. For example,"owner.*"
returns the test owner,"owner.firstName"
returns the owner's firstName, and so on. Use this for fields that are located in related entities, such as the user's firstName and lastName, or the project name. Select these fields by providing the name of the relationship.
-
download
Booleanrequired
The parameter defines whether you want to download your query results to your local client as a CSV file. The maximum number of results returned is 10,000 items.
-
format
stringoptional
Defines the result set format. Can be used together with distinct.
structured
- Retrieve root entity including related entities as nested JSON objects/arrays. Default.flat
- Fetches only related entities. For example, fetch all owners of tests. The selected fields must be from a single entity only. Ordering must be according to the selected field(s). This format flattens all nested JSON objects to a single object and is designed for UI drop down filters to show only relevant values.value
- for fetching single field values in array. This format is suitable for tags as those are plain values, but not owners, projects, locations (as we need both id and name for those). Only one field can be selected when using value format. It can also be used in ordering. This format is designed for UI drop down filters to show only relevant values.
-
distinct
stringoptional
Used in combination with the flat and value result formats (see there) to eliminate duplicates.
-
skip
numberoptional
Defines how many rows to skip from the response. Used together with limit.
-
limit
integeroptional
Defines the number of result rows to fetch. Default is 100. Use 0 to return the total count. Used together with Skip.
-
filters
stringoptional
Configures search filter criteria. A slightly modified Mongodb style query language is supported:
$or, $and, $nor, $not
- supported logical operators. The $not operator is more powerful than in Mongodb as it can be used as top level logical operator. It can also be used as Mongodb $not operator in field expressions.$eq, $ne, $lt, $lte, $gt, $gte, $between (plus an array value with two arguments), $in, $nin, $startswith, $endswith, $null (true/false value), $notnull (true/false value), $like, $ilike
- supported field expression operators.$eq
,$in
- Supported equality operators. $eq is a strict equals operator. For lists, use $in to filter by items inside the list.$ilike
operator - A case and diacritic insensitive search for string fields.
Example: To return ids that are greater than 100 and less than 500, use the following filter:
"filters": { "$and": [ { "id": { "$gt": 100 } }, { "id": { "$lt": 500 } } ] }
-
timeOffset
integeroptional
Defines a time offset in minutes to format the date fields. The provided value needs to take into account Daylight Saving Time. Used when exporting results as a CSV file (by setting the download attribute to true).
-
ordering
integeroptional
Configures sorting: 1 means ascending; -1 means descending. Provide an array of order definitions for fields. Supports ordering by root entity fields or related entity field through dot notation ("project.name") like
fields
does.Example: To order project names ascending and ids descending, use the following:
"ordering": [ { "project.name": 1 }, { "id": -1 } ]
-
platform
stringoptional
Filters results by BlazeMeter test type. Do not use together with
filterByActivePlatform
. Provide one of the following values:functional
performance
-
filterByActivePlatform
stringoptional
Set this to true to filter results by the BlazeMeter test type set in the user preferences. Do not use together with
platform
.
Search
curl 'https://a.blazemeter.com/api/v4/search' \
-X POST \
-H 'Content-Type: application/json' \
--user 'api_key_id:api_key_secret' \
-d '{ "<em>attribute</em>": ["<em>value</em>"] }'
Run a SearchSearch POST Body (JSON)
{
"accountId": 12345,
"entity": "test-union",
"fields": [
"*",
"owner.*",
"project.*",
"locations.*",
"workspace.*",
"tags.*"
],
"workspaceId": null,
"filters": {
"$and": [
{
"name": {
"$ilike": "Nove"
}
}
]
},
"ordering": [
{
"updated": -1
}
],
"skip": 0,
"limit": 15
}
Search Response Attributes
Response200 Created
{
"accountId": 12345,
"workspaceId": [
12345
],
"error": null,
"limit": 15,
"skip": 0,
"total": 1,
"result": [
{
"owner": {
"firstName": "Sasha",
"lastName": "Miller",
"displayName": "Sasha Miller",
"id": 1000005
},
"workspace": {
"accountId": 12345,
"name": "Workspace XYZ",
"id": 12345
},
"created": 1669390442,
"tagIds": [],
"locationIds": [
"us-east4-a"
],
"project": {
"name": "Project ABC",
"id": 12345,
"workspaceId": 12345
},
"testType": "taurus",
"type": "test",
"userId": 1600425,
"tags": null,
"duration": 1200,
"numVirtualUsers": 20,
"name": "East coast test November_25_4:34 PM",
"locations": [
{
"id": "us-east4-a",
"name": "US East (Virginia)",
"type": 0,
"refId": "us-east4-a",
"title": "US East (Virginia, Google)",
"provider": "Google Cloud Platform",
"workspaceIds": null
}
],
"id": 11841279,
"projectId": 12345,
"updated": 1669390471,
"numEngines": 1
}
],
"api_version": 4,
"request_id": "460d9b7978784"
}