Skip to main content
POST
/
api
/
v1
/
causality-graph
curl -X POST "https://api.factagora.com/api/v1/causality-graph" \
  -H "Authorization: Bearer fag_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/economic-analysis"}'
{
  "nodes": [
    { "id": "n1", "label": "Rising interest rates" },
    { "id": "n2", "label": "Lower consumer spending" },
    { "id": "n3", "label": "Reduced GDP growth" },
    { "id": "n4", "label": "Higher unemployment" }
  ],
  "edges": [
    { "from": "n1", "to": "n2", "label": "causes" },
    { "from": "n2", "to": "n3", "label": "leads to" },
    { "from": "n3", "to": "n4", "label": "leads to" }
  ],
  "meta": {
    "total_nodes": 4,
    "total_edges": 3,
    "executionTimeMs": 640
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.factagora.com/llms.txt

Use this file to discover all available pages before exploring further.

Analyze cause-and-effect relationships from a URL or uploaded file (PDF, Markdown). Returns nodes (concepts/events) and directed edges (causal relationships) that can be used to visualize cause-and-effect chains.

Endpoints

MethodPathInput
POST/api/v1/causality-graphJSON body with url
POST/api/v1/causality-graph/filemultipart/form-data with file

POST /api/v1/causality-graph

Request Body

url
string
required
URL of the page or document to extract causal relationships from.
curl -X POST "https://api.factagora.com/api/v1/causality-graph" \
  -H "Authorization: Bearer fag_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/economic-analysis"}'

POST /api/v1/causality-graph/file

Request Body (multipart/form-data)

file
file
required
PDF or Markdown file to extract causal relationships from.
curl -X POST "https://api.factagora.com/api/v1/causality-graph/file" \
  -H "Authorization: Bearer fag_your_api_key" \
  -F "file=@analysis.pdf"

Response

nodes
array
List of concept or event nodes in the graph.
edges
array
List of directed causal relationships between nodes.
meta
object
{
  "nodes": [
    { "id": "n1", "label": "Rising interest rates" },
    { "id": "n2", "label": "Lower consumer spending" },
    { "id": "n3", "label": "Reduced GDP growth" },
    { "id": "n4", "label": "Higher unemployment" }
  ],
  "edges": [
    { "from": "n1", "to": "n2", "label": "causes" },
    { "from": "n2", "to": "n3", "label": "leads to" },
    { "from": "n3", "to": "n4", "label": "leads to" }
  ],
  "meta": {
    "total_nodes": 4,
    "total_edges": 3,
    "executionTimeMs": 640
  }
}