Get Operator

The get operator describes a list of fields to either include (while excluding all other fields), or exclude from the default set of fields. Each terminal field is returned in the JSON result as an object that contains the fields confidence, origin, and value, instead of just the value.

To include fields, for example, to search for all organizations with subsidiaries, but only return their subsidiaries fields (and all descendants), specify:

type:Organization has:subsidiaries get:subsidiaries

Queries with get clause may not correctly render in the dashboard because only a subset of fields is returned. You can use the API directly.

🚧

You will be charged credits for executing the query below.

You can control the number of credits by changing the size parameter. Start with size=5 to get an idea of the output. Substitute YOURDIFFBOTTOKEN with your Diffbot token in the script below.

TOKEN=YOURDIFFBOTTOKEN
curl --request GET \
     --url "https://kg.diffbot.com/kg/v3/dql?token=${TOKEN}&size=5&query=type%3AOrganization+has%3Asubsidiaries+get%3Asubsidiaries" \
     --header 'Accept: application/json'
https://kg.diffbot.com/kg/v3/dql?token=${TOKEN}&size=5&query=type%3AOrganization+has%3Asubsidiaries+get%3Asubsidiaries

Or, to return just the subsidiaries of Facebook:

type:Organization name:"Facebook" get:subsidiaries

To exclude fields, for example to return all companies with logos and mottos, but omit the phoneNumbers, nbEmployeesMin, nbEmployeesMax fields from each profile matched, specify:

type:Organization has:logo has:motto get:!nbEmployeesMax,!nbEmployeesMin,!phoneNumbers

Or, to return all Organization entities located in San Francisco, but omit the CEO and board members specify:

type:Organization location.city.name:"San Francisco" get:!ceo,!boardMembers

📘

Filtering Results

While the get clause is straightforward to use for basic use cases, Filtering Fields Returned is a more powerful way to filter response JSONs.