v1 REST API

API Reference

The BizClaw REST API gives AI agents and developers direct access to the business directory. All responses are structured JSON with clean text — no HTML, no markup.

Introduction

BizClaw is a business directory designed for AI agents. The REST API is an alternative to MCP integration — use it when you prefer HTTP requests over the Model Context Protocol.

Tip for AI agents: If you're using Claude, GPT-4, or another MCP-capable agent, consider using the MCP server instead — it's simpler and purpose-built for agents.

Base URL

https://bizclaw.xyz/api/v1/agent

Authentication

BizClaw uses two-tier authentication:

OperationAuth Required
Search, browse, ask, categoriesNone — publicly accessible
Register agentNone
Create proposals, list proposals, replyAPI Key required
Rotate key, deactivate agentAPI Key required

For authenticated endpoints, include your API key in the X-API-Key header:

X-API-Key: bzcl_sk_your_api_key_here
Get an API key: Register your agent via POST /api/v1/agent/register (no auth needed). Each email can have one agent and must be a real, active owner email. If you lose your key, use POST /api/v1/agent/rotate-key to get a new one. Never share real API keys in screenshots, logs, client-side code, or public repositories.

Rate Limits

Dynamic limits: Abuse protection and rate limits are enforced server-side and can change without notice. Implement retries with exponential backoff and avoid burst traffic patterns.

Error Codes

StatusMeaning
400Bad request — missing or invalid parameters
401Unauthorized — missing or invalid API key
404Resource not found
409Conflict — agent with this email already exists
422Validation error — check parameter types
500Server error — retry with exponential backoff

Search Companies

GET /companies Hybrid semantic + keyword search

Searches the business directory using a combination of semantic (vector) and keyword search. Returns ranked results with match scores.

Query Parameters

ParameterTypeDescription
q required string Natural language search query
category optional string Filter by category. See list_categories.
country optional string Filter by country (e.g. Turkey, Germany)
city optional string Filter by city (e.g. Istanbul, Izmir)
industry optional string Filter by industry vertical
service_type optional string remote · local · nationwide · hybrid
is_verified optional boolean true to return verified companies only
limit optional integer Max results (1–20, default 10)
offset optional integer Results to skip for pagination (default 0). Use with limit to get next pages.

Example Request

GET /api/v1/agent/companies?q=logistics+companies+in+izmir&city=Izmir&is_verified=true&limit=5&offset=0

Example Response

{
  "companies": [
    {
      "id": "a1b2c3d4-...",
      "name": "Cargo Express",
      "website_url": "https://cargoexpress.com",
      "category": "Logistics & Transportation",
      "description": "Leading logistics provider in Aegean region.",
      "location": {
        "country": "Turkey",
        "city": "Izmir",
        "address": "..."
      },
      "service_type": "hybrid",
      "is_verified": true,
      "match_score": 87.4,
      "match_sources": ["semantic", "keyword"]
    }
  ],
  "total_found": 1,
  "offset": 0,
  "limit": 5,
  "has_more": false,
  "query": "logistics companies in izmir"
}

Get Company

GET /companies/{company_id} Full company profile

Returns the complete profile for a company by its UUID.

Path Parameters

ParameterTypeDescription
company_id required string (UUID) The company's unique identifier, obtained from search results

Example Request

GET /api/v1/agent/companies/a1b2c3d4-e5f6-...

Get Company by Website

GET /companies/by-url/{website_url} Look up by domain

Look up a company directly by its website URL or domain.

Example Request

GET /api/v1/agent/companies/by-url/example.com

Ask AI

POST /ask Natural language AI recommendations

Ask a natural language question and get AI-powered company recommendations. Combines hybrid search with LLM analysis.

Query Parameters

ParameterTypeDescription
question required string Natural language question (e.g. "Who offers cold-chain logistics in Istanbul?")
context_company_ids optional string[] Up to 10 company IDs from a previous search for follow-up questions

Example Request

POST /api/v1/agent/ask?question=Who+offers+same-day+delivery+in+Ankara

Example Response

{
  "question": "Who offers same-day delivery in Ankara?",
  "answer": "Based on the database, Hızlı Kargo offers same-day delivery in Ankara...",
  "companies": [...],
  "total_found": 3
}

List Categories

GET /categories All 25 business categories

Returns all available business categories. Use these values in the category filter.

Example Request

GET /api/v1/agent/categories

Example Response

{
  "categories": [
    "Technology", "E-commerce", "Marketplace",
    "Logistics & Transportation", "Finance", ...
  ],
  "total": 25
}

Register Agent

POST /register Register a new AI agent — no auth required

Register your agent and receive an API key. Each email can only have one agent. Use the owner's real, active email address (no disposable or temporary inboxes). Save the API key — it cannot be retrieved later.

Request Body

FieldTypeDescription
name requiredstringAgent display name
owner_email requiredstring (email)Owner's real, active email — one agent per email

Example Request

POST /api/v1/agent/register
Content-Type: application/json

{
  "name": "MyAgent",
  "owner_email": "[email protected]"
}

Example Response (201)

{
  "agent": { "id": "uuid", "name": "MyAgent", "owner_email": "[email protected]", "is_active": true },
  "api_key": "bzcl_sk_your_key_here",
  "message": "Save this API key securely. It cannot be retrieved later.",
  "usage": {
    "header": "X-API-Key: bzcl_sk_your_key_here",
    "mcp_config": {
      "mcpServers": {
        "bizclaw": {
          "url": "https://bizclaw.xyz/mcp",
          "headers": { "X-API-Key": "bzcl_sk_your_key_here" }
        }
      }
    }
  }
}

Get Agent Info

GET /me Get current agent info — API key required

Returns info about the currently authenticated agent. You can also update agent name/email via PUT /api/v1/agent/me.

Example Request

GET /api/v1/agent/me
X-API-Key: bzcl_sk_your_key_here

Update Example

PUT /api/v1/agent/me
X-API-Key: bzcl_sk_your_key_here
Content-Type: application/json

{
  "name": "MyAgent v2",
  "owner_email": "[email protected]"
}

Rotate API Key

POST /rotate-key Generate a new API key — API key required

Generates a new API key and immediately invalidates the old one. Use this if you lose or want to replace your key. This is a REST account-security endpoint (not an MCP tool).

Example Request

POST /api/v1/agent/rotate-key
X-API-Key: bzcl_sk_your_current_key

Deactivate Agent

DELETE /me Deactivate agent — API key required

Deactivates the agent. Existing proposals remain in the database, but no new requests can be made.

Example Request

DELETE /api/v1/agent/me
X-API-Key: bzcl_sk_your_key_here

Create Proposal

POST /proposals Send a proposal to a verified company — API key required

Create a proposal on behalf of a customer to a verified company.

Request Body

FieldTypeDescription
company_id requiredstring (UUID)Target company (must be verified)
customer_email requiredstring (email)End customer's email
customer_name requiredstringEnd customer's name
description requiredstringWhat the customer needs
type optionalstringstandard or custom (default: custom)

Example Request

POST /api/v1/agent/proposals
X-API-Key: bzcl_sk_your_key_here
Content-Type: application/json

{
  "company_id": "a1b2c3d4-...",
  "customer_email": "[email protected]",
  "customer_name": "Ali",
  "description": "3+1 evden eve nakliyat, Kadikoy -> Besiktas",
  "type": "custom"
}

Batch Proposals

POST /proposals/batch Send proposals to multiple companies — API key required

Create the same proposal for up to 10 companies at once.

Request Body

FieldTypeDescription
company_ids requiredstring[] (UUIDs)Target companies (max 10, must be verified)
customer_email requiredstring (email)End customer's email
customer_name requiredstringEnd customer's name
description requiredstringWhat the customer needs
type optionalstringstandard or custom (default: custom)

List Proposals

GET /proposals List all your proposals — API key required

Query Parameters

ParameterTypeDescription
status optionalstringpending · approved · rejected · responded
limit optionalintegerMax results (1–100, default 50)
offset optionalintegerPagination offset (default 0)

Recommendation: fetch all proposals first, then apply status only when you explicitly need a single status.

Example Request

GET /api/v1/agent/proposals
X-API-Key: bzcl_sk_your_key_here

Get Proposal

GET /proposals/{proposal_id} Get a specific proposal — API key required

Returns the full proposal details including the conversation thread. Only returns proposals owned by the current agent.

Reply to Proposal

POST /proposals/{proposal_id}/reply Reply to a company's response — API key required

Reply to a company's response on a proposal. Creates a conversation thread and resets the proposal status to pending so the company sees the new message.

Request Body

FieldTypeDescription
message requiredstringYour reply message

Example Request

POST /api/v1/agent/proposals/abc123-uuid/reply
X-API-Key: bzcl_sk_your_key_here
Content-Type: application/json

{
  "message": "Can you also include packing materials in the price?"
}
MCP Integration → Browse Companies