# Diffbot KG

> **You are on:** `https://beta-api.paywithlocus.com/api` | [llms.txt](https://beta.paywithlocus.com/llms.txt)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API |
> |---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com |
> | Beta | beta.paywithlocus.com | beta-api.paywithlocus.com |
> | Stage | stage.paywithlocus.com | stage-api.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Knowledge Graph — search 10B+ entities and enrich company/person records.

**Category:** Data / Intelligence | **Website:** [www.diffbot.com](https://www.diffbot.com) | **Docs:** [docs.diffbot.com/reference/knowledge-graph](https://docs.diffbot.com/reference/knowledge-graph)

## Access Methods

| Method | Base URL | Auth |
|--------|----------|------|
| **MPP (Tempo)** | `https://diffbot-kg.mpp.paywithlocus.com/diffbot-kg/` | HTTP 402 auto-payment |
| **Wrapped API** | `https://beta-api.paywithlocus.com/api/wrapped/diffbot-kg/` | `Authorization: Bearer <LOCUS_API_KEY>` |

**OpenAPI discovery:** `GET https://diffbot-kg.mpp.paywithlocus.com/openapi.json`

## Endpoints

### Search (DQL)

Search Diffbot Knowledge Graph of 10B+ entities using Diffbot Query Language.

**Estimated cost:** $0.03–$1.50 (25 credits/entity)

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | DQL query string (e.g. type:Organization locations.city.name:"San Francisco") |
| `type` | string | No | Query type: query, text, queryTextFallback (default: query) |
| `from` | number | No | Pagination offset (default 0) |
| `size` | number | No | Max entities to return (default 50) |
| `filter` | string | No | JsonPath expression to filter response fields |
| `jsonmode` | string | No | Response format: extended or id |
| `nonCanonicalFacts` | boolean | No | Include non-canonical facts |

```bash
curl -X POST https://diffbot-kg.mpp.paywithlocus.com/diffbot-kg/search \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>","type":"<string>","from":"<number>","size":"<number>","filter":"<string>","jsonmode":"<string>","nonCanonicalFacts":"<boolean>"}'
```

### Enhance

Enrich a person or organization record with Knowledge Graph data using minimal identifiers.

**Estimated cost:** $0.03 ($0.12 with refresh)

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `type` | string | Yes | Entity type: Person or Organization |
| `name` | string | string[] | No | Entity name(s) |
| `url` | string | string[] | No | Website URL(s) for the entity |
| `email` | string | string[] | No | Email address(es) (Person only) |
| `phone` | string | No | Phone number |
| `employer` | string | No | Employer name (Person only) |
| `title` | string | No | Job title (Person only) |
| `location` | string | No | Location of the entity |
| `refresh` | boolean | No | Re-crawl the entity (costs 100 credits instead of 25) |
| `size` | number | No | Number of matches to return (default 1) |
| `threshold` | number | No | Match confidence threshold (0-1) |

```bash
curl -X POST https://diffbot-kg.mpp.paywithlocus.com/diffbot-kg/enhance \
  -H "Content-Type: application/json" \
  -d '{"type":"<string>","name":"<string | string[]>","url":"<string | string[]>","email":"<string | string[]>","phone":"<string>","employer":"<string>","title":"<string>","location":"<string>","refresh":"<boolean>","size":"<number>","threshold":"<number>"}'
```
