How to use the Octolens API
Create an API Key
In Octolens, navigate to Settings and then the API tab.- Click “Add new key”
- Choose a name for your API key
- Choose an expiration date for your API key from the dropdown
- Click Create
Quick Start
Base URL
Rate Limits
500 requests per hour CheckX-RateLimit-* headers for usage
Authentication
Bearer token in the Authorization headerExample Request
Endpoints
1. POST /mentions
Fetch mentions matching your keywords with optional filtering. Returns posts sorted by timestamp (newest first).Parameters
| Name | Type | Description |
|---|---|---|
view | number | View ID to use for filtering. View filters are merged with other filters. |
limit | number | Maximum number of results to return (1-100). Default: 20 |
cursor | string | Pagination cursor from previous response |
includeAll | boolean | Include low-relevance posts. When false, only high and medium relevance posts are returned. Default: false |
Filters (11 options)
You can also check out our AI Filter Wizard to help construct the filter you want.| Filter | Type | Description |
|---|---|---|
filters.source | string[] | Filter by source platforms. Prefix with ! to exclude. Values: twitter, reddit, github, linkedin, youtube, hackernews, devto, stackoverflow, bluesky, newsletter, podcast |
filters.sentiment | string[] | Filter by sentiment. Prefix with ! to exclude. Values: positive, neutral, negative |
filters.keyword | string[] | Filter by specific keyword IDs. Prefix with ! to exclude. |
filters.language | string[] | Filter by language codes (ISO 639-1). Prefix with ! to exclude. Values: en, es, fr, de, pt, it, nl, ja, ko, zh |
filters.tag | string[] | Filter by tags. Prefix with ! to exclude. |
filters.bookmarked | boolean | Filter to only bookmarked (true) or non-bookmarked (false) posts. |
filters.engaged | boolean | Filter to only engaged (true) or non-engaged (false) posts. |
filters.minXFollowers | number | Minimum X/Twitter follower count for the author. |
filters.maxXFollowers | number | Maximum X/Twitter follower count for the author. |
filters.startDate | string | Only return posts from this date onwards (ISO 8601). |
filters.endDate | string | Only return posts up to this date (ISO 8601). |
Request Body
Response
2. GET /keywords
List all keywords configured for your organization. Returns keyword details including platforms and status.Response
3. GET /views
List all saved views for your organization. Views contain pre-configured filters that can be used with the mentions endpoint.Response
Error Codes
The API uses standard HTTP status codes. Here are the possible error responses.401 unauthorized
Missing or invalid API key. Ensure you include the Authorization header with a valid API key.
403 forbidden
API key is valid but doesn’t have permission to access this resource.
404 not_found
The requested resource (e.g., view ID) was not found.
429 rate_limit_exceeded
Too many requests. Check the X-RateLimit-* headers for limits and reset time.