
Ads.txt Generator API
Web Development
Create ads.txt and app-ads.txt files by describing your requirements in natural language.
Authentication
All API requests require a valid API key passed in the Authorization header as a Bearer token.
Rate Limit
100 requests per minute
Endpoints
1 endpoint available
Overview
The Ads.txt Generator API uses AI to create both ads.txt and app-ads.txt files for advertising transparency.
What are ads.txt and app-ads.txt?
- ads.txt: Lists authorized digital sellers for website ad inventory
- app-ads.txt: Lists authorized digital sellers for mobile app ad inventory
- Industry standard for preventing ad fraud
Content Types
- Publisher IDs (Google AdSense, etc.)
- Ad network specifications
- Authorized sellers and resellers
- Direct vs reseller relationships
Endpoints
POST
/v1/tools/ads-txt-generatorGenerate ads.txt and app-ads.txt files
Request Body
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| domain | string | Required | Website domain (e.g., example.com) |
| requirements | string | Required | Description of ad networks, publisher IDs, and authorized sellers to include |
Response Example
{
"success": true,
"data": {
"adsTxt": "google.com, pub-1234567890, DIRECT, f08c47fec0942fa0\namazon-adsystem.com, 1234, DIRECT\nindexexchange.com, 5678, RESELLER",
"appAdsTxt": "google.com, pub-1234567890, DIRECT, f08c47fec0942fa0\napplovin.com, 9012, DIRECT",
"explanation": "These ads.txt files were generated based on your domain and requirements."
}
}Error Codes
400
Bad Request - Missing domain or requirements401
Unauthorized - Invalid or missing API key429
Too Many Requests - Rate limit exceeded500
Internal Server ErrorCode Examples
curl -X POST https://api.opentools.ca/v1/tools/ads-txt-generator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "example.com",
"requirements": "Add Google AdSense publisher ID pub-1234567890. Include Amazon and Index Exchange as resellers. Add AppLovin for mobile app ads."
}'