DatacloudCompany SOQL Request and Response
Use a SOQL request to search the Data.com database for companies.
There is a 24-hour rolling quota on the number of API calls that you can make. Your organization gets 1,000 daily calls for every Data.com Prospector license purchased. For example, an organization with 10 prospector licenses has a daily limit of 10,000 Search API calls (1,000 x 10 = 10,000). Call quotas are implemented at the Salesforce organization level.
You can see how many records a query returns by using Count()
in the SELECT
clause. For details, see Count()
Used in SELECT
Clause.
You can scroll through large result sets from Datacloud objects two different ways.
When no LIMIT
is specified, queryMore()
returns the entire response in 25-record chunks. You can scroll through the full set of results 25 records at a time.
A LIMIT
that’s set from 1 and 100 returns the actual number of records or the number of records equal to the LIMIT
value, whichever is fewer. This query returns only the first 75 records from a response that contains more than 1,000 records. A next page is not returned.
Specify a LIMIT
greater than or equal to the number of records in the response to scroll through large responses in 100-record chunks. For example, in a response with 1,900 records and a LIMIT
that’s set to 2,000, you can scroll through the complete response in chunks of 100 records. You can only scroll through as many records as are specified in the LIMIT
. If your LIMIT
is less than the number of records in the response, queryMore()
processes only the number of records that’s specified in the LIMIT
value.
You can also scroll through query results by using LIMIT
and OFFSET
in your SOQL statement.
-
LIMIT
: Specifies the number of results that are displayed per page. ALIMIT
of 100 displays 100 records for each page of the results. -
OFFSET
: Specifies at which record the results start to display. An offset of 100 would start displaying results from the one hundred and first (101) record.
Use a LIMIT
clause in combination with OFFSET
if you need to retrieve subsequent subsets of the same result set. For example, retrieve the first 100 rows of a query using the following:
You could then retrieve the next 100 rows, 101 through 200, using the following query:
Keep incrementing the OFFSET
to scroll through all the results.
OFFSET
has a limit of 2000. Your query fails with an OFFSET
of 2001 or greater.
The maximum LIMIT
is 100. A query with a LIMIT
greater than 100 defaults to 100.
The Search API supports only one field expression clause for ORDER BY
. Entering more than one field expression clause for ORDER BY
causes an error.
We recommend that you use ORDER BY
on an appropriate field so that results are returned in a consistent order.
Lists of hidden and free fields, and a SOQL response for the DatacloudCompany object.
Some field data is hidden until you purchase the record. This table lists the fields and shows how each is hidden.
Hidden fields with a null or empty value have a blank entry for the field.
Field Name | Obfuscated Example |
---|---|
AnnualRevenue | 0.0 |
Description | ****** |
DunsNumber | ****** |
EmployeeQuantityGrowthRate | ****** |
Fax | +*.***.**** |
FortuneRank | ****** |
IncludedinSnP500 | ****** |
IsInactive | ****** |
IsOwned | ****** |
NaicsCode | ****** |
NaicsDesc | ****** |
NumberOfEmployees | 0 |
Ownership | ****** |
Phone | +*.***.**** |
PremisesMeasure | ****** |
PremisesMeasureReliability | ****** |
PremisesMeasureUnit | ****** |
PriorYearEmployees | 0 |
PriorYearRevenue | 0.0 |
SalesTurnoverGrowthRate | ****** |
Sic | ****** |
SicDesc | ****** |
Street | ****** |
TickerSymbol | ****** |
TradeStyle | ****** |
YearStarted | ****** |
Here are the fields you get from DatacloudCompany.
Field | Description |
---|---|
ActiveContacts | The number of active contacts for the selected company. |
City | The city where the company is located. |
CompanyId | The Data.com identification number for the company. |
Country | The country where the company is located. |
Industry | A classification of the type of industry for the company. |
Name | The name of the company as it is in Data.com. |
Site | The type of location such as branch, headquarters, or single location. |
State | The state, province, or territory where the company is located. |
UpdatedDate | The last date the information for the company was updated. |
Website | The website for the company. |
Zip | An official postal code designation for the company. |
The response contains the fields that you specified in the SELECT statement: SELECT City
,State
,Street
,NumberOfEmployees
,CompanyId
. Certain fields are hidden until you purchase the company record.
Number | City | State | Street | NumberOfEmployees | CompanyId |
---|---|---|---|---|---|
1 | Milpitas | CA | ****** | ****** | 4829908 |
2 | Los Altos Hills | CA | ****** | ****** | 8599704 |
3 | San Bruno | CA | 950 Blaze Ave FL 1 | 520 | 8590022 |
4 | San Jose | CA | ****** | ****** | 4829903 |
5 | San Jose | CA | ****** | ****** | 4828398 |
6 | San Jose | CA | ****** | ****** | 211524 |
7 | Lawrenceville | GA | ****** | ****** | 2132417 |
8 | Raleigh | NC | ****** | ****** | 8590470 |
9 | Raleigh | NC | ****** | ****** | 4832196 |
The following table shows the company records after they have been purchased. Previously obfuscated fields are visible after they are purchased.
Number | City | State | Street | NumberOfEmployees | CompanyId |
---|---|---|---|---|---|
1 | Milpitas | CA | 755 Trailblazer Dr | 4829908 | |
2 | Los Altos Hills | CA | 11633 Astro Ln | 1 | 8599704 |
3 | San Bruno | CA | 950 Blaze Ave FL 1 | 520 | 8590022 |
4 | San Jose | CA | 125 Sassy St. | 1 | 4829903 |
5 | San Jose | CA | 1028 Codey Dr | 1 | 4828398 |
6 | San Jose | CA | 170 W Cloudy Dr | 71825 | 211524 |
7 | Lawrenceville | GA | 5030 Appy Pkwy | 9900 | 2132417 |
8 | Raleigh | NC | 6401 Ruth Rd Ste 300 | 8590470 | |
9 | Raleigh | NC | 301 N Brandy St | 4832196 |
Here is a list of the logical operators that are supported in SOQL queries with DatacloudCompany object.
This table lists the fields that you can use with specific logical operators to construct your SOQL query.
Field | = | != | < | <= | > | >= | LIKE | IN | NOT IN | ORDER BY |
---|---|---|---|---|---|---|---|---|---|---|
AnnualRevenue | √ | √ | √ | √ | √ | |||||
City (1,2) | √ | √ | √ | √ | ||||||
CompanyId | √ | √ | ||||||||
Country (2) | √ | √ | √ | |||||||
DunsNumber | √ | √ | ||||||||
IsInactive | √ | |||||||||
NaicsCode (1) | √ | √ | √ | |||||||
Name (1,2) | √ | √ | √ | √ | √ | √ | ||||
NumberOfEmployees | √ | √ | √ | √ | √ | |||||
Ownership | √ | |||||||||
Sic (1) | √ | √ | √ | |||||||
Site | √ | √ | ||||||||
State (2) | √ | √ | √ | |||||||
Website (1) | √ | |||||||||
Zip (1) | √ | √ | √ |
1 Wildcards are implicitly used in some queries when the LIKE
operator is used.
2 ORDER BY
accepts only one field.
Here are some tips on how logical operators work with which fields in DatacloudCompany queries.
The Datacloud objects directly query the Data.com database cache. The queries are passed directly to Data.com. Some of the fields and logical operators execute queries differently than standard Salesforce objects. Query results can be different than expected.
AnnualRevenue
is type currency. It must be numbers only: 1000, not $1,000.
-
=
An exact search on the value that was entered. It must be enclosed in single quotation marks. The
AnnualRevenue
number must be enclosed in single quotation marks. This is a limiting search. -
<
A search for any amount less than the value entered, including companies with a revenue value of 0 (zero). The value that was entered is not matched.
-
<=
A search for any amount less than or equal to the value entered, including companies with a revenue value of 0 (zero).
-
>
A search for any amount greater than the value that was entered. The value that was entered is not matched.
-
>=
A search for any amount greater than or equal to the value that was entered, not including companies with a revenue value of 0 (zero).
The string (for example 'Boston'
) must be enclosed in single quotation marks.
-
=
An exact search on the value entered. It must be enclosed in single quotation marks. You can search on only one city at a time.
-
LIKE
Automatically does a fuzzy search. Some common misspellings, inadvertent omissions, and other typographical errors can return the desired results.
-
IN
Searches for the exact string provided. You can search on a comma-separated list.
-
ORDER BY
Orders the results of a query by the
City
field. You can have only one field forORDER BY
. You can indicate ascending (ASC
) or descending (DESC
) order. If you do not specify an order, the results are returned in random order.
CompanyId
is type string. The value must be enclosed in single quotation marks. Search on a single value or a comma-separated list of values.
-
=
An exact search on the value entered. It must be enclosed in single quotation marks.
-
IN
Searches for a string that represents a unique number that identifies the company in the Data.com database. It must be enclosed in single quotation marks and nested in parentheses. You can search on a comma-separated list.
-
=
An exact search on the value entered. It must be enclosed in single quotation marks.
-
IN
Searches for a string that represents the name of a country that’s enclosed in single quotation marks nested in parentheses. You can search on a comma-separated list.
-
ORDER BY
You can specify ascending (
ASC
) or descending (DESC
) order. You can specify only oneORDER BY
field.
-
=
An exact search on the value entered. It must be enclosed in single quotation marks.
-
IN
Searches for a nine-digit number assigned by Dun & Bradstreet (D&B) to identify unique business establishments.
IsInactive
is most commonly included with another field for search. IsInactive
includes inactive records (true
) or excludes inactive records (false
) from the search.
-
=
IsInactive
is type boolean. There are two possible values,true
orfalse
. Do not enclose the string in single quotation marks.
-
=
An exact search on the value that was entered. The
NaicsCode
is a string and must be enclosed in single quotation marks. -
IN
Searches on a string that must be enclosed in single quotation marks nested in parentheses. You can search on a comma-separated list.
-
LIKE
You can search one or more
NaicsCode
s with or without a wildcard.The following query finds
NaicsCode
s that starts with 81 and any value for the third and fifth digits.This following query finds any
NaicsCode
that starts with 445.
Don't use a wildcard as the first digit. If you use a wildcard as the first digit, the response is empty.
-
=
An exact search on the value that was entered. It must be enclosed in single quotation marks. The search treats everything after the first wildcard as valid.
-
!=
Excludes the string that was entered from the search. You can use only one wildcard.
-
LIKE
Does a fuzzy search on the string that was entered. Also searches the
Tradestyle
andWebsite
fields. -
IN
Searches on a string that was entered. The string must be enclosed in single quotation marks nested in parentheses. You can enter comma-separated lists.
-
NOT IN
Excludes the string that was entered from the search. The string must be enclosed in single quotation marks.
-
ORDER BY
Orders the results of a query by the
Name
field. You can indicate ascending (ASC
) or descending (DESC
) order. Here is an example.
-
=
An exact search on the value that was entered. This is a limiting search.
-
<
A search for any number less than the value that was entered.
-
<=
A search for any number less than or equal to the value that was entered.
-
>
A search for any number greater than the value that was entered.
-
>=
A search for any number greater than or equal to the value that was entered.
-
=
A string comparison. The string must be enclosed in single quotation marks. There are four possible values.
Private
Public
Government
Other
-
=
An exact match for a string of numbers. It must be enclosed in single quotation marks. You can search on only one string at a time.
-
IN
An exact match for a string of numbers. It must be enclosed in single quotation marks and nested in parentheses. It can be a comma-separated list.
-
LIKE
You can search one or more
Sic
numbers with or without a wildcard.The following query finds numbers that start with 5, the third digit must be 1, and the second and fourth digits can be any digit.
The following query finds numbers that start with 7 and end with 1.
Do not use a wildcard as the first digit. If you use a wildcard as the first digit, the response is empty.
-
=
A string that represents the type of location of a company. It must be enclosed in single quotation marks.
-
IN
A string that represents the type of location of a company. It must be enclosed in single quotation marks nested in parentheses. You can use a comma-separated list.
-
=
A standard two-letter abbreviation that represents states or provinces in countries.
-
IN
A standard two letter abbreviation that represents states or provinces in countries. You must enclose each state abbreviation in single quotation marks nested in parentheses. You can use a comma-separated list.
-
ORDER BY
Orders the results of a query by the State field. You can indicate ascending (ASC) or descending (DESC) order.
-
LIKE
A string that represents the URL or website address of a company. You can use complete or partial website addresses. You can query on a comma-separate list of websites.
-
!=
Exclude a numeric string that represents a postal ZIP code area.
-
LIKE
Searches for a numeric string that represents a complete or partial postal code. Partial postal codes do not need wildcards. The following query returns all records that have a postal ZIP code starting with 941.
-
NOT IN
Exclude a numeric string that represents a postal ZIP code area. Partial postal codes do not need wildcards. The following query excludes all records that have a postal ZIP code starting with 97. The string you are excluding must be enclosed in single quotation marks nested in parentheses.