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.

queryMore()

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.

LIMIT and OFFSET

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. A LIMIT 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.

ORDER BY

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.

DatacloudCompany Hidden Fields

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 NameObfuscated Example
AnnualRevenue0.0
Description******
DunsNumber******
EmployeeQuantityGrowthRate******
Fax+*.***.****
FortuneRank******
IncludedinSnP500******
IsInactive******
IsOwned******
NaicsCode******
NaicsDesc******
NumberOfEmployees0
Ownership******
Phone+*.***.****
PremisesMeasure******
PremisesMeasureReliability******
PremisesMeasureUnit******
PriorYearEmployees0
PriorYearRevenue0.0
SalesTurnoverGrowthRate******
Sic******
SicDesc******
Street******
TickerSymbol******
TradeStyle******
YearStarted******

DatacloudCompany Free Fields

Here are the fields you get from DatacloudCompany.

FieldDescription
ActiveContactsThe number of active contacts for the selected company.
CityThe city where the company is located.
CompanyIdThe Data.com identification number for the company.
CountryThe country where the company is located.
IndustryA classification of the type of industry for the company.
NameThe name of the company as it is in Data.com.
SiteThe type of location such as branch, headquarters, or single location.
StateThe state, province, or territory where the company is located.
UpdatedDateThe last date the information for the company was updated.
WebsiteThe website for the company.
ZipAn official postal code designation for the company.

DatacloudCompany Query Results before Purchase

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.

NumberCityStateStreetNumberOfEmployeesCompanyId
1MilpitasCA************4829908
2Los Altos HillsCA************8599704
3San BrunoCA950 Blaze Ave FL 15208590022
4San JoseCA************4829903
5San JoseCA************4828398
6San JoseCA************211524
7LawrencevilleGA************2132417
8RaleighNC************8590470
9RaleighNC************4832196

DatacloudCompany Query Results after Purchase

The following table shows the company records after they have been purchased. Previously obfuscated fields are visible after they are purchased.

NumberCityStateStreetNumberOfEmployeesCompanyId
1MilpitasCA755 Trailblazer Dr 4829908
2Los Altos HillsCA11633 Astro Ln18599704
3San BrunoCA950 Blaze Ave FL 15208590022
4San JoseCA125 Sassy St.14829903
5San JoseCA1028 Codey Dr14828398
6San JoseCA170 W Cloudy Dr71825211524
7LawrencevilleGA5030 Appy Pkwy99002132417
8RaleighNC6401 Ruth Rd Ste 300 8590470
9RaleighNC301 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=!=<<=>>=LIKEINNOT INORDER 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

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).

City

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 for ORDER 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

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.

Country

  • =

    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 one ORDER BY field.

DunsNumber

  • =

    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

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 or false. Do not enclose the string in single quotation marks.

NaicsCode

  • =

    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 NaicsCodes with or without a wildcard.

    The following query finds NaicsCodes 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.

Name

  • =

    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 and Website 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.

NumberOfEmployees

  • =

    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.

Ownership

  • =

    A string comparison. The string must be enclosed in single quotation marks. There are four possible values.

    • Private
    • Public
    • Government
    • Other

Sic

  • =

    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.

Site

  • =

    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.

State

  • =

    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.

Website

  • 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.

Zip

  • !=

    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.