CommentKeyword API Documentation
Integrate Instagram automation into your applications with our powerful Keywords API. Manage comment keywords and automated responses programmatically.
Getting Started
Base URL: https://commentkeyword.com/api
What You Can Do
- List and search your Instagram comment keywords
- Create new keywords with automated responses
- Update existing keywords and their settings
- Delete keywords when no longer needed
- Configure comment replies and DM messages
Authentication
CommentKeyword uses Personal Access Tokens (PATs) for API authentication. Tokens are scoped to your workspace and require specific permissions.
Generating Access Tokens
- Navigate to Settings in your CommentKeyword dashboard
- Go to the API Access section
- Click "Generate New Token"
- Assign the required permissions:- keywords:read- View keywords
- keywords:write- Create and update keywords
- keywords:delete- Delete keywords
 
- Copy the token immediately (it won't be shown again)
Using Tokens
Include your token in the Authorization header:
curl -H "Authorization: Bearer YOUR_TOKEN_HERE" \
     https://commentkeyword.com/api/keywordsSecurity Best Practices
- • Keep tokens secure - treat them like passwords
- • Rotate tokens regularly for security
- • Revoke tokens when no longer needed
- • Assign minimal permissions required for your use case
API Endpoints
/api/keywordsRetrieve all keywords for your workspace with filtering and pagination.
Query Parameters
- search- Filter keywords containing text
- status- Filter by active/inactive
- limit- Number of results (max 100)
- offset- Pagination offset
Permission Required
keywords:read/api/keywordsCreate a new keyword for automated Instagram engagement.
Required Fields
- keyword- The keyword to match
Optional Fields
- matchMode- "exact" or "contains"
- commentReplies- Array of reply variants
- dmMessages- Array of DM variants
- delaySec- Delay before DM (1-60 sec)
Permission Required
keywords:write/api/keywords/{id}Retrieve details for a specific keyword by ID.
Path Parameters
- id- Keyword ID (number)
Permission Required
keywords:read/api/keywords/{id}Update an existing keyword. Only provided fields will be updated.
Updatable Fields
- keyword- Change the keyword text
- matchMode- Update match type
- commentReplies- Update replies
- dmMessages- Update DM messages
- delaySec- Update delay timing
- isActive- Enable/disable keyword
Permission Required
keywords:write/api/keywords/{id}Permanently delete a keyword.
Path Parameters
- id- Keyword ID (number)
Permission Required
keywords:deleteError Handling
The API uses standard HTTP status codes and returns detailed error information in JSON format.
Error Response Format
{
  "error": "Error Type",
  "message": "Detailed error description"
}Common Status Codes
Code Examples
JavaScript/Node.js
const COMMENTKEYWORD_TOKEN = 'your_token_here';
const BASE_URL = 'https://commentkeyword.com/api';
// Get all keywords
async function getKeywords() {
  const response = await fetch(`${BASE_URL}/keywords`, {
    headers: {
      'Authorization': `Bearer ${COMMENTKEYWORD_TOKEN}`,
      'Content-Type': 'application/json'
    }
  });
  return response.json();
}
// Create a new keyword
async function createKeyword(keyword, options = {}) {
  const response = await fetch(`${BASE_URL}/keywords`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${COMMENTKEYWORD_TOKEN}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      keyword,
      ...options
    })
  });
  return response.json();
}Python
import requests
COMMENTKEYWORD_TOKEN = 'your_token_here'
BASE_URL = 'https://commentkeyword.com/api'
headers = {
    'Authorization': f'Bearer {COMMENTKEYWORD_TOKEN}',
    'Content-Type': 'application/json'
}
def get_keywords():
    response = requests.get(f'{BASE_URL}/keywords', headers=headers)
    return response.json()
def create_keyword(keyword, **options):
    data = {'keyword': keyword, **options}
    response = requests.post(f'{BASE_URL}/keywords', json=data, headers=headers)
    return response.json()cURL
# List keywords
curl -H "Authorization: Bearer YOUR_TOKEN" \
     https://commentkeyword.com/api/keywords
# Create keyword  
curl -X POST \
     -H "Authorization: Bearer YOUR_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"keyword": "sale", "matchMode": "contains"}' \
     https://commentkeyword.com/api/keywords
# Update keyword
curl -X PUT \
     -H "Authorization: Bearer YOUR_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"delaySec": 15, "isActive": false}' \
     https://commentkeyword.com/api/keywords/15Rate Limits
Rate Limit Headers
Rate limit information is included in response headers:
- X-RateLimit-Limit- Request limit per minute
- X-RateLimit-Remaining- Remaining requests
- X-RateLimit-Reset- Unix timestamp when limit resets
