Request
| Authentication | |
|---|---|
token | Cache and insert token into example requests (15d expiry) |
| Query parameters | |
|---|---|
fields | Attributes to include in response (default: |
| Request body application/json | |
|---|---|
content | The text you’d like Diffbot Natural Language to process. (1–100,000 characters) |
lang | Language of the text specified as an ISO 639-1 code. Review our supported languages for more information. (default: |
format |
(default: |
documentType | Optional. Provides context to the model and may produce better results. |
customSummary | Define custom parameters for summary generation. |
maxNumberOfSentences | Maximum number of sentences for the generated summary. (1–10, default: |
Example request
curl --request POST \
--url 'https://nl.diffbot.com/v1/?fields=entities,sentiment,facts,records,sentences&token=<DIFFBOT_TOKEN>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '[{"content":"Diffbot is a startup based in Menlo Park."}]'
Response
| 200 | |
|---|---|
errors | |
entities | |
name | |
diffbotUri | |
confidence | |
salience | |
sentiment | |
allUris | |
allTypes | |
name | |
diffbotUri | |
dbpediaUri | |
mentions | |
text | |
beginOffset | |
endOffset | |
isPronoun | |
confidence | |
location | |
latitude | |
longitude | |
precision | |
sentiment | |
facts | |
humanReadable | |
entity | |
name | |
diffbotUri | |
confidence | |
allUris | |
allTypes | |
name | |
diffbotUri | |
dbpediaUri | |
isCustom | |
entityIndex | Index of this entity in the field “entities” (if requested) |
property | |
name | |
diffbotUri | |
description | |
value | |
name | |
diffbotUri | |
confidence | |
allUris | |
allTypes | |
name | |
diffbotUri | |
dbpediaUri | |
isCustom | |
entityIndex | Index of this entity in the field “entities” (if requested) |
qualifiers | |
property | |
name | |
diffbotUri | |
description | |
value | |
name | |
diffbotUri | |
confidence | |
confidence | |
evidence | |
passage | One or more sentences where the fact was extracted from |
entityMentions | |
text | |
beginOffset | |
endOffset | |
isPronoun | |
confidence | |
valueMentions | |
text | |
beginOffset | |
endOffset | |
isPronoun | |
confidence | |
records | Array of entities with attributes extracted from inputDocument according to the KG schema (/docs/ontology/) |
categories | |
iabv1 | |
id | |
name | |
path | |
confidence | |
isPrimary | |
iabv2 | |
id | |
name | |
path | |
confidence | |
isPrimary | |
diffbot | |
id | |
name | |
path | |
confidence | |
isPrimary | |
sentences | |
beginOffset | |
endOffset | |
language | Language of the text specified as an ISO 639-1 code. |
summary | Generated summary. |
[
{
"sentiment": 0,
"entities": [
{
"name": "Diffbot",
"diffbotUri": "https://diffbot.com/entity/EYX1i02YVPsuT7fPLUYgRhQ",
"confidence": 0.99898225,
"salience": 0.95394653,
"sentiment": 0,
"isCustom": false,
"allUris": [
"http://www.wikidata.org/entity/Q17052069"
],
"allTypes": [
{
"name": "organization",
"diffbotUri": "https://diffbot.com/entity/EN1ClYEdMMQCxB6AWTkT3mA",
"dbpediaUri": "http://dbpedia.org/ontology/Organisation"
}
],
"mentions": [
{
"text": "Diffbot",
"beginOffset": 0,
"endOffset": 7,
"confidence": 0.99898225
}
],
"location": {
"latitude": 37.456104,
"longitude": -122.1763,
"precision": 0.1
}
},
{
"name": "Menlo Park",
"diffbotUri": "https://diffbot.com/entity/EQiAUr370NpW1gvx-V4fTrQ",
"confidence": 0.9996269,
"salience": 0.9082091,
"sentiment": 0,
"isCustom": false,
"allUris": [
"http://www.wikidata.org/entity/Q74195"
],
"allTypes": [
{
"name": "location",
"diffbotUri": "https://diffbot.com/entity/EiCyWUm4lNziqgLHx47iAIQ",
"dbpediaUri": "http://dbpedia.org/ontology/Place"
},
{
"name": "administrative area",
"diffbotUri": "https://diffbot.com/entity/EcTIu1tWKPouIa6qZtSpc4A",
"dbpediaUri": "http://dbpedia.org/ontology/PopulatedPlace"
},
{
"name": "city",
"diffbotUri": "https://diffbot.com/entity/EzdJrGHiyMWu0XbSn101rFA",
"dbpediaUri": "http://dbpedia.org/ontology/City"
}
],
"mentions": [
{
"text": "Menlo Park",
"beginOffset": 30,
"endOffset": 40,
"confidence": 0.9996269
}
],
"location": {
"latitude": 37.454166,
"longitude": -122.17861,
"precision": 6.708204
}
},
{
"name": "startup company",
"diffbotUri": "https://diffbot.com/entity/EfX0EeXroOmaXrLe-SylIuw",
"confidence": 0.81958973,
"salience": 0.6474858,
"sentiment": 0,
"isCustom": false,
"allUris": [],
"mentions": [
{
"text": "startup",
"beginOffset": 13,
"endOffset": 20,
"confidence": 0.81958973
}
]
}
],
"facts": [
{
"humanReadable": "[Diffbot] headquarters [Menlo Park]",
"entity": {
"name": "Diffbot",
"diffbotUri": "https://diffbot.com/entity/EYX1i02YVPsuT7fPLUYgRhQ",
"confidence": 0.99898225,
"allUris": [
"http://www.wikidata.org/entity/Q17052069"
],
"allTypes": [
{
"name": "organization",
"diffbotUri": "https://diffbot.com/entity/EN1ClYEdMMQCxB6AWTkT3mA",
"dbpediaUri": "http://dbpedia.org/ontology/Organisation"
}
],
"isCustom": false,
"entityIndex": 1
},
"property": {
"name": "headquarters",
"diffbotUri": "https://docs.diffbot.com/docs/ont-organization#location"
},
"value": {
"name": "Menlo Park",
"diffbotUri": "https://diffbot.com/entity/EQiAUr370NpW1gvx-V4fTrQ",
"confidence": 0.9996269,
"allUris": [
"http://www.wikidata.org/entity/Q74195"
],
"allTypes": [
{
"name": "location",
"diffbotUri": "https://diffbot.com/entity/EiCyWUm4lNziqgLHx47iAIQ",
"dbpediaUri": "http://dbpedia.org/ontology/Place"
},
{
"name": "administrative area",
"diffbotUri": "https://diffbot.com/entity/EcTIu1tWKPouIa6qZtSpc4A",
"dbpediaUri": "http://dbpedia.org/ontology/PopulatedPlace"
},
{
"name": "city",
"diffbotUri": "https://diffbot.com/entity/EzdJrGHiyMWu0XbSn101rFA",
"dbpediaUri": "http://dbpedia.org/ontology/City"
}
],
"isCustom": false,
"entityIndex": 0
},
"qualifiers": [
{
"property": {
"name": "is current"
},
"value": {
"name": "true"
},
"confidence": 0
}
],
"confidence": 0.95,
"evidence": [
{
"passage": "Diffbot is a startup based in Menlo Park.",
"entityMentions": [
{
"text": "Diffbot",
"beginOffset": 0,
"endOffset": 7,
"confidence": 0.99898225
}
],
"valueMentions": [
{
"text": "Menlo Park",
"beginOffset": 30,
"endOffset": 40,
"confidence": 0.9996269
}
]
}
]
}
]
}
]
| 400Invalid input | |
|---|---|
messages |