LogoAidirs

Developer API

Submit AI Tools Programmatically

Use our REST API or npm SDK to batch-submit your AI tools, check credits, and manage listings — all from your codebase.

Authentication

All API requests require a Bearer token in the Authorization header. Generate your API key from the Dashboard.

http
Authorization header
Authorization: Bearer aidirs_your_api_key_here

Your API key is shown only once when generated. Store it securely and never expose it in client-side code.

Credits & Plans

Each submission consumes credits based on the plan level. Purchase credits before making API calls.

starter

1 credit

Basic listing + dofollow backlinks

Popular
pro

2 credits

Featured + social sharing

sponsor

6 credits

Featured + 7-day site-wide placement

Endpoints

GET/api/v1/credits

Check your current credit balance and subscription plan.

json
Response
{
  "credits": 8,
  "plan": "free"
}
POST/api/v1/submit

Submit an AI tool to the directory. Name and description are automatically generated by AI.

json
{
  "url": "https://example.com",
  "plan": "starter"
}

Required fields: url, plan (starter | pro | sponsor). Name and description are auto-generated by AI.

SDK / npm Package

Use the official @aidirs/sdk package for a type-safe, zero-config experience in Node.js / TypeScript projects.

bash
Install
pnpm add @aidirs/sdk
typescript
Usage
import { Aidirs } from "@aidirs/sdk";

const client = new Aidirs({ apiKey: process.env.AIDIRS_API_KEY! });

// Check credits
const { credits, plan } = await client.credits();
console.log(`Credits: ${credits}, Plan: ${plan}`);

// Submit a tool
const result = await client.submit({
  url: "https://example.com",
  plan: "pro",
});

console.log(result);
// { status, url, creditsUsed, creditsRemaining }
typescript
Batch submit
// Submit multiple tools — stops early on 402 (no credits)
const { results, errors } = await client.batchSubmit([
  { url: "https://tool-a.com", plan: "starter" },
  { url: "https://tool-b.com", plan: "pro" },
  { url: "https://tool-c.com", plan: "starter" },
]);

console.log(`Submitted: ${results.length}, Errors: ${errors.length}`);

SDK Features

Full TypeScript types
Auto error parsing
Batch submit helper
Rate-limit aware retries
ESM & CJS dual build
Zero dependencies

Code Examples

cURL

bash
Check credits
curl https://aidirs.best/api/v1/credits \
  -H "Authorization: Bearer aidirs_your_key"
bash
Submit a tool
curl -X POST https://aidirs.best/api/v1/submit \
  -H "Authorization: Bearer aidirs_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "plan": "starter"
  }'

Node.js (fetch)

javascript
submit.mjs
const API_KEY = process.env.AIDIRS_API_KEY;
const BASE = "https://aidirs.best";

async function submitTool(url, plan = "starter") {
  const res = await fetch(`${BASE}/api/v1/submit`, {
    method: "POST",
    headers: {
      Authorization: `Bearer ${API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ url, plan }),
  });

  if (!res.ok) {
    const err = await res.json();
    throw new Error(err.error || res.statusText);
  }

  return res.json();
}

const result = await submitTool("https://example.com", "pro");
console.log(result);

Python

python
submit.py
import os, requests

API_KEY = os.environ["AIDIRS_API_KEY"]
BASE = "https://aidirs.best"

def submit_tool(url: str, plan: str = "starter"):
    res = requests.post(
        f"{BASE}/api/v1/submit",
        headers={
            "Authorization": f"Bearer {API_KEY}",
            "Content-Type": "application/json",
        },
        json={"url": url, "plan": plan},
    )
    res.raise_for_status()
    return res.json()

result = submit_tool("https://example.com", "pro")
print(result)

Error Handling

400Invalid request body or URL
401Missing or invalid API key
402Insufficient credits
409URL already submitted
429Rate limit exceeded
json
Error response format
{
  "error": "Insufficient credits",
  "required": 2,
  "available": 1
}

Rate Limits

10 requests / minute

Per API key. Exceeding this limit returns a 429 status code. Retry after 60 seconds.