Skip to content

Enhance (GET)

GEThttps://kg.diffbot.com/kg/v3/enhance

Enrich a person or organization record with partial data input.

Enhance is an enrichment API to find a person or organization using partial data as input. Enhance scores several candidates against the submitted query and returns the best match. More information in the query helps Enhance models estimate with more confidence and will typically result in better matches and a higher score for the matches.

A minimal request specifies the entity type, a name, and optionally a location:

GET /kg/v3/enhance?type={type}&name={name}&location={address}

Where {type} is either Person or Organization, {name} is the name of the entity and {address} is a complete or partial address of the entity.

You can specify more/other input, such as url or employer. The supported parameters are listed below.

Scoring and Threshold

Enhance uses a cut-off based on the F2 score by default, erring on the side of recall. However, you can control the threshold using the threshold parameter depending on your application's specific needs.

Enhance also returns at most 1 result by default. You can control this with the size parameter. Note that this can cause proportionately more credits to be used if there are more matches returned.

(size parameter is not supported for combine requests.)

Refresh mode

It is possible that some of the origins for the results have not been revisited by our crawler in a while. If you need fresher data than what's available, you can force a refresh with the refresh=true parameter. Any origins that have not been crawled in the last 30 days will be recrawled and merged with the entity found in the Knowledge Graph.

WARNING

The refresh parameter should not be used by default. Refreshing origins in general and refreshing all origins in particular can be a time-consuming request as Enhance needs to recrawl pages before merging them into the result. If you need only specific origins refreshed, you can also control that using the refreshOrigins parameter.

Search mode

By default, Enhance returns entities in the Knowledge Graph. It can also search the web for the queried entity with the search=true parameter. Search results are scored for a match and merged with the entity found in the Knowledge Graph.

WARNING

The search parameter should not be used by default. It can be very slow and the quality of results are usually variable external websites. In our experience, this parameter is not usually necessary.

Example

bash
curl --request GET \
  --url 'https://kg.diffbot.com/kg/v3/enhance?token=<DIFFBOT_TOKEN>&type=Organization&name=Diffbot&filter=%24.name%3B%24.diffbotUri%3B%24.homepageUri%3B%24.twitterUri%3B%24.nbEmployees' \
  --header 'Accept: application/json'
json
{
  "version": 3,
  "hits": 1,
  "kgversion": "477",
  "request_ctx": {
    "query": {
      "type": "Organization",
      "name": "Diffbot"
    },
    "query_ctx": {
      "search": "OFF"
    }
  },
  "data": [
    {
      "score": 0.7037951087035074,
      "esscore": 1840.4940185546875,
      "entity": {
        "twitterUri": "twitter.com/diffbot",
        "name": "Diffbot",
        "diffbotUri": "http://diffbot.com/entity/EYX1i02YVPsuT7fPLUYgRhQ",
        "homepageUri": "diffbot.com",
        "nbEmployees": 40
      },
      "errors": []
    }
  ],
  "errors": []
}

API Definition

Generated from v3.0.0 of the ENHANCE API OpenAPI specification.

Enrich a person or organization record with partial data input

Request

Authentication
tokenquery
Cache and insert token into example requests (15d expiry)
Query parameters
typestring required

Diffbot entity type

One of: PersonOrganization

idstring

DiffbotId of entity to enhance. Parameter can be used with types Person and Organization

namestring[]

Name of the entity to enhance. Parameter can be used with types Person and Organization

urlstring[]

Origin or homepage URI of entity to enhance. Parameter can be used with types Person and Organization

phonestring

Phone of the entity to enhance. Parameter can be used with types Person and Organization

emailstring[]

Email of the entity to enhance. Parameter can be used only with type Person

employerstring

Employer of the entity to enhance. Parameter can be used only with type Person

titlestring

Title of the entity to enhance. Parameter can be used only with type Person

schoolstring

School of the entity to enhance. Parameter can be used only with type Person

locationstring

Location of the entity to enhance. Parameter can be used with types Person and Organization

descriptionstring

Description of the entity to enhance. Parameter can be used with types Person and Organization

ipstring

IP address of the entity to enhance. Parameter can be used with types Person and Organization

customIdstring

User defined ID for correlation

sizeinteger (int32)

Maximum number of results to return (default: 1)

thresholdnumber (double)

Enhance similarity threshold

refreshboolean

refresh=true indicates that Diffbot will attempt to recrawl all the origins of the identified entity and reconstruct the returned entity from this refreshed data. (default: false)

searchboolean

search=true indicates that Diffbot will attempt to search the web for origins for the search query and merge relevant results with whats found in the KG. (default: false)

nonCanonicalFactsboolean

nonCanonicalFacts=true returns non-canonical facts. (default: false)

jsonmodestring

jsonmode=extended returns origin information for facts.

One of: extended

filterstring

Semi-colon separated path filter to filter response json. You can use a simple dot notation skills.name or a JsonPath expression such as $.name;$.locations.country.name. For more advanced options, see JsonPath Filtering for syntax.

filterExcludestring

Semi-colon separated path filter to filter and exclude data from response json. You can use a simple dot notation skills.name or a JsonPath expression such as $.name;$.locations.country.name. For more advanced options, see JsonPath Filtering for syntax.

Example request

bash
curl --request GET \
  --url 'https://kg.diffbot.com/kg/v3/enhance?type=Person&size=1&refresh=false&search=false&nonCanonicalFacts=false&token=<DIFFBOT_TOKEN>' \
  --header 'Accept: application/json'

Response

200Enhanced entity
versioninteger (int32)

Response version

hitsinteger (int32)

Number of matches returned

kgversionstring

Version of KG that was queried

request_ctxobject

Request context

queryobject | object | string

Submitted query

typestring

Diffbot entity type

namestring[]

Name of the entity to enhance. Parameter can be used with types Person and Organization

urlstring[]

Origin or homepage URI of entity to enhance. Parameter can be used with types Person and Organization

locationstring

Location of the entity to enhance. Parameter can be used with types Person and Organization

ipstring

IP address of the entity to enhance. Parameter can be used with types Person and Organization

phonestring

Phone of the entity to enhance. Parameter can be used with types Person and Organization

descriptionstring

Description of the entity to enhance. Parameter can be used with types Person and Organization

emailstring[]

Email of the entity to enhance. Parameter can be used only with type Person

employerstring

Employer of the entity to enhance. Parameter can be used only with type Person

titlestring

Title of the entity to enhance. Parameter can be used only with type Person

schoolstring

School of the entity to enhance. Parameter can be used only with type Person

query_ctxobject

Query context. Example: submitted query parameters etc.

dataobject[]
scorenumber (double)

Enhance score

esscorenumber (double)
entityobject

Enhanced entity. Can be null if no entity was found.

errorsstring[]
refreshInfoobject

Refresh info for debug

refreshDeltaobject
entity_ctxobject

Entity-level context

errorsstring[]
searchInfoobject

Search info for debug

400Error parsing request
codeinteger (int32)

Status code (same as the HTTP status code)

messagestring

Status message

request_ctxobject

Request context

queryobject | object | string

Submitted query

typestring

Diffbot entity type

namestring[]

Name of the entity to enhance. Parameter can be used with types Person and Organization

urlstring[]

Origin or homepage URI of entity to enhance. Parameter can be used with types Person and Organization

locationstring

Location of the entity to enhance. Parameter can be used with types Person and Organization

ipstring

IP address of the entity to enhance. Parameter can be used with types Person and Organization

phonestring

Phone of the entity to enhance. Parameter can be used with types Person and Organization

descriptionstring

Description of the entity to enhance. Parameter can be used with types Person and Organization

emailstring[]

Email of the entity to enhance. Parameter can be used only with type Person

employerstring

Employer of the entity to enhance. Parameter can be used only with type Person

titlestring

Title of the entity to enhance. Parameter can be used only with type Person

schoolstring

School of the entity to enhance. Parameter can be used only with type Person

query_ctxobject

Query context. Example: submitted query parameters etc.

bulkjobStatusobject

Bulkjob status

job_idstring

Bulkjob Id

namestring

Bulkjob name

refreshboolean

Is Refresh enabled for this job?

searchstring

Is Search enabled for this job?

messagestring

Bulkjob status message

jobs_totalinteger (int32)

Number of jobs in bulkjob

jobs_completedinteger (int32)

Number of jobs completed in bulkjob.

statusstring

Status of Bulkjob. One of {NOT_STARTED, IN_PROCESS, COMPLETE, COMPLETE_WITH_FAILURES, STOPPED, ERROR_FINALIZING, UNKNOWN}

estimate_remaining_timeinteger (int64)

Estimated remaining time for bulkjob to complete (in seconds). null if job is completed or not started.

submit_time_msinteger (int64)

Bulkjob submit time

start_time_msinteger (int64)

Bulkjob start time

completed_time_msinteger (int64)

Bulkjob completed time

total_resultsinteger (int32)

Total results

bulkjobIdstring
totalJobsinteger (int32)
finishedJobsinteger (int32)
estimateRemainingTimeSecinteger (int64)
submitTimeMsinteger (int64)
startTimeMsinteger (int64)
completedTimeMsinteger (int64)
totalResultsinteger (int32)
fileSizeBytesinteger (int64)

Size of download file in bytes

reportsobject[]

Coverage reports generated for this bulkjob

reportIdstring

Coverage Report ID

statusstring

Status of report generation. One of {NOT_STARTED, IN_PROCESS, COMPLETE, UNKNOWN}

formatstring

Export format

specstring

The spec defines the columns to export. This is applicable for csv, xls and xslx formats.

Export spec specifies how to export the entity JSON to a csv. A simple export spec looks like name;summary. To specify more complex export spec, including specifying how many of a list of industries to return, or the ideal employment record, see Exporting Columnar Format and JsonPath Filtering.

exportfilestring
exportSeparatorstring

Separator for multi-value fields when exporting columnar results

filterstring

Semi-colon separated path filter to filter response json. You can use a simple dot notation skills.name or a JsonPath expression such as $.name;$.locations.country.name. For more advanced options, see JsonPath Filtering for syntax.

onlyMatchesboolean

Return only records that have a match

errorboolean

true if error

401Token not specified or other client errors
requestIdstring

Identifier of the rejected request, also returned in the X-Diffbot-RequestId header

codeinteger (int32)

Status code (same as the HTTP status code)

messagestring

Status message

429Insufficient credits
codeinteger (int32)

Status code (same as the HTTP status code)

messagestring

Status message

request_ctxobject

Request context

queryobject | object | string

Submitted query

typestring

Diffbot entity type

namestring[]

Name of the entity to enhance. Parameter can be used with types Person and Organization

urlstring[]

Origin or homepage URI of entity to enhance. Parameter can be used with types Person and Organization

locationstring

Location of the entity to enhance. Parameter can be used with types Person and Organization

ipstring

IP address of the entity to enhance. Parameter can be used with types Person and Organization

phonestring

Phone of the entity to enhance. Parameter can be used with types Person and Organization

descriptionstring

Description of the entity to enhance. Parameter can be used with types Person and Organization

emailstring[]

Email of the entity to enhance. Parameter can be used only with type Person

employerstring

Employer of the entity to enhance. Parameter can be used only with type Person

titlestring

Title of the entity to enhance. Parameter can be used only with type Person

schoolstring

School of the entity to enhance. Parameter can be used only with type Person

query_ctxobject

Query context. Example: submitted query parameters etc.

bulkjobStatusobject

Bulkjob status

job_idstring

Bulkjob Id

namestring

Bulkjob name

refreshboolean

Is Refresh enabled for this job?

searchstring

Is Search enabled for this job?

messagestring

Bulkjob status message

jobs_totalinteger (int32)

Number of jobs in bulkjob

jobs_completedinteger (int32)

Number of jobs completed in bulkjob.

statusstring

Status of Bulkjob. One of {NOT_STARTED, IN_PROCESS, COMPLETE, COMPLETE_WITH_FAILURES, STOPPED, ERROR_FINALIZING, UNKNOWN}

estimate_remaining_timeinteger (int64)

Estimated remaining time for bulkjob to complete (in seconds). null if job is completed or not started.

submit_time_msinteger (int64)

Bulkjob submit time

start_time_msinteger (int64)

Bulkjob start time

completed_time_msinteger (int64)

Bulkjob completed time

total_resultsinteger (int32)

Total results

bulkjobIdstring
totalJobsinteger (int32)
finishedJobsinteger (int32)
estimateRemainingTimeSecinteger (int64)
submitTimeMsinteger (int64)
startTimeMsinteger (int64)
completedTimeMsinteger (int64)
totalResultsinteger (int32)
fileSizeBytesinteger (int64)

Size of download file in bytes

reportsobject[]

Coverage reports generated for this bulkjob

reportIdstring

Coverage Report ID

statusstring

Status of report generation. One of {NOT_STARTED, IN_PROCESS, COMPLETE, UNKNOWN}

formatstring

Export format

specstring

The spec defines the columns to export. This is applicable for csv, xls and xslx formats.

Export spec specifies how to export the entity JSON to a csv. A simple export spec looks like name;summary. To specify more complex export spec, including specifying how many of a list of industries to return, or the ideal employment record, see Exporting Columnar Format and JsonPath Filtering.

exportfilestring
exportSeparatorstring

Separator for multi-value fields when exporting columnar results

filterstring

Semi-colon separated path filter to filter response json. You can use a simple dot notation skills.name or a JsonPath expression such as $.name;$.locations.country.name. For more advanced options, see JsonPath Filtering for syntax.

onlyMatchesboolean

Return only records that have a match

errorboolean

true if error

500Internal Server Error
codeinteger (int32)

Status code (same as the HTTP status code)

messagestring

Status message

request_ctxobject

Request context

queryobject | object | string

Submitted query

typestring

Diffbot entity type

namestring[]

Name of the entity to enhance. Parameter can be used with types Person and Organization

urlstring[]

Origin or homepage URI of entity to enhance. Parameter can be used with types Person and Organization

locationstring

Location of the entity to enhance. Parameter can be used with types Person and Organization

ipstring

IP address of the entity to enhance. Parameter can be used with types Person and Organization

phonestring

Phone of the entity to enhance. Parameter can be used with types Person and Organization

descriptionstring

Description of the entity to enhance. Parameter can be used with types Person and Organization

emailstring[]

Email of the entity to enhance. Parameter can be used only with type Person

employerstring

Employer of the entity to enhance. Parameter can be used only with type Person

titlestring

Title of the entity to enhance. Parameter can be used only with type Person

schoolstring

School of the entity to enhance. Parameter can be used only with type Person

query_ctxobject

Query context. Example: submitted query parameters etc.

bulkjobStatusobject

Bulkjob status

job_idstring

Bulkjob Id

namestring

Bulkjob name

refreshboolean

Is Refresh enabled for this job?

searchstring

Is Search enabled for this job?

messagestring

Bulkjob status message

jobs_totalinteger (int32)

Number of jobs in bulkjob

jobs_completedinteger (int32)

Number of jobs completed in bulkjob.

statusstring

Status of Bulkjob. One of {NOT_STARTED, IN_PROCESS, COMPLETE, COMPLETE_WITH_FAILURES, STOPPED, ERROR_FINALIZING, UNKNOWN}

estimate_remaining_timeinteger (int64)

Estimated remaining time for bulkjob to complete (in seconds). null if job is completed or not started.

submit_time_msinteger (int64)

Bulkjob submit time

start_time_msinteger (int64)

Bulkjob start time

completed_time_msinteger (int64)

Bulkjob completed time

total_resultsinteger (int32)

Total results

bulkjobIdstring
totalJobsinteger (int32)
finishedJobsinteger (int32)
estimateRemainingTimeSecinteger (int64)
submitTimeMsinteger (int64)
startTimeMsinteger (int64)
completedTimeMsinteger (int64)
totalResultsinteger (int32)
fileSizeBytesinteger (int64)

Size of download file in bytes

reportsobject[]

Coverage reports generated for this bulkjob

reportIdstring

Coverage Report ID

statusstring

Status of report generation. One of {NOT_STARTED, IN_PROCESS, COMPLETE, UNKNOWN}

formatstring

Export format

specstring

The spec defines the columns to export. This is applicable for csv, xls and xslx formats.

Export spec specifies how to export the entity JSON to a csv. A simple export spec looks like name;summary. To specify more complex export spec, including specifying how many of a list of industries to return, or the ideal employment record, see Exporting Columnar Format and JsonPath Filtering.

exportfilestring
exportSeparatorstring

Separator for multi-value fields when exporting columnar results

filterstring

Semi-colon separated path filter to filter response json. You can use a simple dot notation skills.name or a JsonPath expression such as $.name;$.locations.country.name. For more advanced options, see JsonPath Filtering for syntax.

onlyMatchesboolean

Return only records that have a match

errorboolean

true if error