{
  "openapi": "3.0.1",
  "info": {
    "title": "LeadGraph (AI B2B Lead Generation & ICP Scoring)",
    "description": "AI-powered B2B lead generation with LangGraph ICP scoring, knowledge graph, and trigger signals. Scrapes LinkedIn, HackerNews, Google Maps and Apollo. Scores leads against your ICP using Groq (free) or OpenAI.",
    "version": "1.0",
    "x-build-id": "BOo36yhXHBQYcBI8G"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/antoniovfranco~leadgraph/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-antoniovfranco-leadgraph",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/antoniovfranco~leadgraph/runs": {
      "post": {
        "operationId": "runs-sync-antoniovfranco-leadgraph",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/antoniovfranco~leadgraph/run-sync": {
      "post": {
        "operationId": "run-sync-antoniovfranco-leadgraph",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "sources",
          "icpConfig"
        ],
        "properties": {
          "sources": {
            "title": "Data Sources",
            "type": "array",
            "description": "One or more sources to scrape leads from. Each object must have a 'type' field: 'linkedin', 'google_maps', 'hackernews', or 'apollo'. Example: [{\"type\":\"hackernews\",\"query\":\"who is hiring\",\"postTypes\":[\"hiring\"]}]"
          },
          "icpConfig": {
            "title": "Ideal Customer Profile (ICP)",
            "type": "object",
            "description": "Define your target customer profile. All fields optional — leave empty to score all leads."
          },
          "triggerTypes": {
            "title": "Trigger Signal Types",
            "type": "array",
            "description": "Which intent signals to detect and add score bonus for."
          },
          "maxLeads": {
            "title": "Max Leads",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of scored leads to push to the dataset (PPE billing cap)."
          },
          "enrichmentLevel": {
            "title": "Enrichment Level",
            "enum": [
              "basic",
              "standard",
              "full"
            ],
            "type": "string",
            "description": "basic = no external API calls; standard = Clearbit company data; full = Clearbit + funding + open jobs."
          },
          "groqApiKey": {
            "title": "Groq API Key (recommended — free tier)",
            "type": "string",
            "description": "Free LLM scoring via Groq (llama-3.3-70b-versatile). Get your key at console.groq.com. Takes priority over OpenAI if both are set."
          },
          "groqModel": {
            "title": "Groq Model",
            "enum": [
              "llama-3.3-70b-versatile",
              "llama3-8b-8192",
              "mixtral-8x7b-32768"
            ],
            "type": "string",
            "description": "Groq model to use for ICP scoring."
          },
          "openaiApiKey": {
            "title": "OpenAI API Key (optional fallback)",
            "type": "string",
            "description": "OpenAI key for ICP scoring. Only used if groqApiKey is not set."
          },
          "openaiModel": {
            "title": "OpenAI Model",
            "enum": [
              "gpt-4o-mini",
              "gpt-4o",
              "gpt-4-turbo"
            ],
            "type": "string",
            "description": "OpenAI model. Only used if groqApiKey is not set."
          },
          "proxyConfig": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings for scraping. Residential proxies recommended for LinkedIn."
          },
          "apolloApiKey": {
            "title": "Apollo.io API Key",
            "type": "string",
            "description": "Required only if using the Apollo source."
          },
          "clearbitApiKey": {
            "title": "Clearbit API Key",
            "type": "string",
            "description": "Required for enrichmentLevel=standard or full."
          },
          "hunterApiKey": {
            "title": "Hunter.io API Key",
            "type": "string",
            "description": "Optional. Used to verify email deliverability."
          },
          "icpDocuments": {
            "title": "ICP Documents (RAG)",
            "type": "array",
            "description": "Optional. Paste free-text documents describing your ideal customer — product descriptions, customer success stories, examples of great and poor fits, pitch deck copy, etc. Each array item is one document. LeadGraph will chunk and retrieve the most relevant context for each lead, injecting it into the AI scoring prompt for personalised, company-specific evaluation. Requires at least one LLM key (groqApiKey or openaiApiKey). For vector search instead of LLM re-ranking, also provide openaiApiKey."
          },
          "icpFiles": {
            "title": "ICP Files — upload documents & images (RAG)",
            "type": "array",
            "description": "Upload PDF, DOCX, TXT, MD, or image files (PNG, JPG, WEBP) that describe your ideal customer — pitch decks, case studies, customer profiles, org charts, screenshots, etc. Text is extracted locally at no cost (PDF and DOCX via open-source libraries). Images require your openaiApiKey: the Actor uses GPT-4o-mini Vision charged to your own OpenAI account. Without the key, images are skipped with a warning. Extracted text is merged with any ICP Documents above before scoring.",
            "items": {
              "type": "string"
            }
          },
          "ragTopK": {
            "title": "RAG Top-K (chunks per lead)",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Number of ICP document chunks retrieved and injected into the scoring prompt per lead. Higher values = more context but more tokens. Default: 3."
          },
          "ragEvalEnabled": {
            "title": "Enable RAGAS Evaluation",
            "type": "boolean",
            "description": "When true, computes RAGAS-inspired metrics at the end of the run (context relevance, faithfulness, ICP coverage) and pushes them to the Dataset. Useful for tuning your ICP documents. Automatically enabled when icpDocuments is provided."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}