search
In SOAP web services, the search operation is used to run a search on a specific record type based on a set of criteria. You can search by defining search filter fields on the record, joined fields on an associated record, search return columns, or joined search return columns from an associated record. The results of the search can be complete records, or a select set of fields specified through search return columns.
SOAP Request
The following example shows a search for customer records that have an email that contains example.com.
<soap:Body>
<platformMsgs:search>
<searchRecord xsi:type="ContactSearch">
<customerJoin xsi:type="CustomerSearchBasic">
<email operator="contains" xsi:type="platformCore:SearchStringField">
<platformCore:searchValue>example.com</platformCore:searchValue>
<email>
<customerJoin>
</searchRecord>
</search>
</soap:Body>
SOAP Response
The following example shows the result of the previous request.
<soapenv:Body>
<searchResponse xmlns="urn:messages_2025_1.platform.webservices.netsuite.com">
<searchResult xmlns="urn:core_2025_1.platform.webservices.netsuite.com">
<status isSuccess="true"/>
<totalRecords>1</totalRecords>
<pageSize>10</pageSize>
<totalPages>1</totalPages>
<pageIndex>1</pageIndex>
<recordList>
<record internalId="983" xsi:type="ns1:Customer"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns1="urn:relationships_2025_1.lists.webservices.netsuite.com">
<ns1:entityId>Shutter Fly</ns1:entityId>
<ns1:isInactive>false</ns1:isInactive>
<ns1:companyName>Shutter Fly, Inc</ns1:companyName>
<ns1:entityStatus internalId="6"><name>LEAD-New</name>
.
.
.
<ns1:customFieldList>
<customField internalId="76" scriptId="custentity_had_order_problems"
xsi:type="BooleanCustomFieldRef"><value>false</value></customField>
</ns1:customFieldList>
</record>
</recordList>
</searchResult>
</searchResponse>
</soapenv:Body>
REST Request
In REST web services, you can filter the collection of all record instances by using the q query parameter to specify filter conditions. Each condition consists of a field name, an operator, and a value. You can join several conditions using the AND / OR logical operators, and you can use () to mark precedence. For more information, see Record Collection Filtering.
The following is an example of a simple query. The spaces in URLs are encoded. The following examples are presented without encoding for clarity.
GET https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer?q=email START_WITH barbara
REST Response
The response is a collection of customer record instances where the value in the email field starts with the value of barbara. The result is a collection resource containing links to resources that match query criteria. The response could be similar to the following.
{
"links": [
{
"rel": "self",
"href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer?limit=1000&offset=0"
}
],
"items": [
{
"links": [
{
"rel": "self",
"href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer/107"
}
],
"id": "107"
},
],
"totalResults": 1
}
Besides record collection filtering, you can also execute SuiteQL queries through REST web services by sending a POST request to the suiteql resource, and specifying the query in the request body after the body parameter q. Using SuiteQL queries, you can return a maximum of 100,000 results. If you expect your queries to return more than 100,000 results, you can use SuiteAnalytics Connect with the NetSuite2.com data source. For more information, see Executing SuiteQL Queries Through REST Web Services.
The following example shows a SuiteQL query executed through REST web services. Note that Prefer: transient is a required header parameter.
POST https://demo123.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=10&offset=10
Prefer: transient
{
"q": "SELECT email, COUNT(*) as count FROM transaction GROUP BY email"
}
The following is a shortened response.
{
"links": ...,
"count": 3,
"offset": 10,
"totalResults": 53,
"items": [
{
"links": [],
"email": "test@netsuite.com",
"count": "143"
},
{
"links": [],
"email": "test2@netsuite.com",
"count": "144"
},
{
"links": [],
"email": "test3@netsuite.com",
"count": "145"
}
],
...
}