---
title: "Process Text"
method: POST
path: "/v1/"
tags: ["Natural Language"]
---

# Process Text

`POST /v1/`

## Query parameters

- `fields` string[]

## Request body

- Document[]
  - `content` string, blob, required — The text you'd like Diffbot Natural Language to process.
  - `lang` string — Language of the text specified as an [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). 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.
  - `customSummary` CustomSummary — Define custom parameters for summary generation.
    - `maxNumberOfSentences` integer — Maximum number of sentences for the generated summary.

## Response `200`

- NaturalLanguageResponse[]
  - `errors` string[]
  - `entities` EntityWithMentions[]
    - `name` string
    - `diffbotUri` string
    - `confidence` number, float
    - `salience` number, float
    - `sentiment` number, float
    - `allUris` string[]
    - `allTypes` EntityType[]
      - `name` string
      - `diffbotUri` string
      - `dbpediaUri` string
    - `mentions` Mention[]
      - `text` string
      - `beginOffset` integer
      - `endOffset` integer
      - `isPronoun` boolean
      - `confidence` number, float
    - `location` Location
      - `latitude` number, float
      - `longitude` number, float
      - `precision` number, float
  - `sentiment` number, float
  - `facts` Fact[]
    - `humanReadable` string
    - `entity` Entity
      - `name` string
      - `diffbotUri` string
      - `confidence` number, float
      - `allUris` string[]
      - `allTypes` EntityType[]
        - `name` string
        - `diffbotUri` string
        - `dbpediaUri` string
      - `isCustom` boolean
      - `entityIndex` integer — Index of this entity in the field "entities" (if requested)
    - `property` Property — https://demo.nl.diffbot.com/schema/#properties
      - `name` string
      - `diffbotUri` string
      - `description` string
    - `value` Entity
      - `name` string
      - `diffbotUri` string
      - `confidence` number, float
      - `allUris` string[]
      - `allTypes` EntityType[]
        - `name` string
        - `diffbotUri` string
        - `dbpediaUri` string
      - `isCustom` boolean
      - `entityIndex` integer — Index of this entity in the field "entities" (if requested)
    - `qualifiers` Qualifier[]
      - `property` Property — https://demo.nl.diffbot.com/schema/#properties
        - `name` string
        - `diffbotUri` string
        - `description` string
      - `value` QualifierValue
        - `name` string
        - `diffbotUri` string
      - `confidence` number, float
    - `confidence` number, float
    - `evidence` Evidence[]
      - `passage` string — One or more sentences where the fact was extracted from
      - `entityMentions` Mention[]
        - `text` string
        - `beginOffset` integer
        - `endOffset` integer
        - `isPronoun` boolean
        - `confidence` number, float
      - `valueMentions` Mention[]
        - `text` string
        - `beginOffset` integer
        - `endOffset` integer
        - `isPronoun` boolean
        - `confidence` number, float
  - `records` object[] — Array of entities with attributes extracted from inputDocument according to the KG schema (https://docs.diffbot.com/docs/ontology)
  - `categories` Categorization — https://demo.nl.diffbot.com/schema/#categories
    - `iabv1` Category[]
      - `id` string
      - `name` string
      - `path` string
      - `confidence` number, float
      - `isPrimary` boolean
    - `iabv2` Category[]
      - `id` string
      - `name` string
      - `path` string
      - `confidence` number, float
      - `isPrimary` boolean
    - `diffbot` Category[]
      - `id` string
      - `name` string
      - `path` string
      - `confidence` number, float
      - `isPrimary` boolean
  - `sentences` Span[]
    - `beginOffset` integer
    - `endOffset` integer
  - `language` string — Language of the text specified as an [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
  - `summary` string — Generated summary.

## Other responses

- `400` — Invalid input

---

[API](https://skmtc.dev/diffbot/apis/web-search.md) · [All operations](https://skmtc.dev/diffbot/apis/web-search/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/diffbot/web-search/revisions/8b88d7dabe63/schema)
