v1

latestOpenAPI 3.0.02026-07-263039205.4 KB
Natural Language

Process Text

post/v1/

Query parameters

fieldsstring[]

Attributes to include in response

Request body

contentstring blob required

The text you'd like Diffbot Natural Language to process.

langstring

Language of the text specified as an ISO 639-1 code. Review our supported languages for more information.

format'plain text' | 'plain text with title'

plain text for free text. plain text with title includes a title separated from the body by two line breaks (e.g. "This is a title\n\nThis is the body").

documentType'organization bio' | 'person bio' | 'news article' | 'address' | 'discussion'

Optional. Provides context to the model and may produce better results.

Example request

[
  {
    "content": "Diffbot is a startup based in Menlo Park."
  }
]

Response

errorsstring[]
sentimentnumber float
recordsobject[]

Array of entities with attributes extracted from inputDocument according to the KG schema (https://docs.diffbot.com/docs/ontology)

languagestring

Language of the text specified as an ISO 639-1 code.

summarystring

Generated summary.

Example response

[
  {
    "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
              }
            ]
          }
        ]
      }
    ]
  }
]