{
 "openapi": "3.1.0",
 "info": {
  "title": "Wrenfield Data keyword API",
  "version": "2026-11-30",
  "description": "Google Keyword Planner search volume, CPC, competition and monthly trends with a prepaid API key. No Google Ads or Apify account. $0.004 per keyword returned with data; $0.01 per database call or $0.25 per live Google Ads call (up to 1,000 keywords); keywords without data are free.",
  "contact": {
   "email": "hello@wrenfielddata.com",
   "url": "https://wrenfielddata.com/keyword-api/"
  }
 },
 "servers": [
  {
   "url": "https://wrenfielddata.com/api/v1"
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "description": "wf_ API key from https://wrenfielddata.com/keyword-api/"
   }
  },
  "schemas": {
   "Row": {
    "type": "object",
    "properties": {
     "keyword": {
      "type": "string"
     },
     "location": {
      "type": "string"
     },
     "language": {
      "type": "string"
     },
     "search_volume": {
      "type": [
       "integer",
       "null"
      ]
     },
     "cpc": {
      "type": [
       "number",
       "null"
      ]
     },
     "competition": {
      "type": [
       "string",
       "null"
      ]
     },
     "monthly_searches": {
      "type": "array",
      "items": {
       "type": "object"
      }
     },
     "found": {
      "type": "boolean"
     },
     "data_source": {
      "type": "string"
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/search-volume": {
   "post": {
    "operationId": "searchVolume",
    "summary": "Search volume, CPC and trends for up to 1,000 keywords",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "keywords"
        ],
        "properties": {
         "keywords": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "maxItems": 1000
         },
         "location": {
          "type": "string",
          "default": "United States",
          "description": "Country, or (with source google_ads) a state, region or city"
         },
         "language": {
          "type": "string",
          "example": "English"
         },
         "source": {
          "type": "string",
          "enum": [
           "database",
           "google_ads"
          ],
          "default": "database"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Rows",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Row"
           }
          },
          "charged_usd": {
           "type": "number"
          },
          "credit_left_usd": {
           "type": "number"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Input error, not charged"
     },
     "401": {
      "description": "Missing or unknown key"
     },
     "402": {
      "description": "Not enough credit, not charged"
     },
     "502": {
      "description": "Upstream error, not charged"
     },
     "503": {
      "description": "Temporarily unavailable, not charged"
     }
    }
   }
  },
  "/balance": {
   "get": {
    "operationId": "balance",
    "summary": "Remaining credit",
    "responses": {
     "200": {
      "description": "Credit",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "credit_usd": {
           "type": "number"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/claim": {
   "post": {
    "operationId": "claim",
    "security": [],
    "summary": "Exchange a paid credit pack for an API key (shown once)",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "email": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "api_key and credit_usd"
     },
     "404": {
      "description": "No unclaimed pack for this email"
     }
    }
   }
  }
 }
}