Appearance
Workflow Prompts
Ready-made prompts for common tasks with the Determ API. Each prompt is inside a code block so you can copy it directly. Paste the prompt into your AI assistant (ChatGPT, Claude, Cursor, or any other) and follow the instructions in brackets.
For best results, combine these prompts with the full API context from the AI Context File. Paste the context first, then the prompt.
1. Explore the API
Use this prompt when you are new to the Determ API and want to understand what is available before writing any code.
I want to explore the Determ API. Here is the complete API context:
[Paste the full context block from the AI Context File page]
List all available endpoints and explain what each one does. Group them by
category (user, metadata, counting, scrolling, keyword management). For each
endpoint, tell me: the HTTP method, the path, what it returns, and when I
would use it.2. Scaffold a project
Use this prompt when you are starting a new integration from scratch and want a working project skeleton with authentication, counting, and scrolling already wired up.
Using the Determ API (base URL: https://api.mediatoolkit.com, auth: Bearer
token in the Authorization header), scaffold a [Python/Node.js/PHP] project
that:
1. Reads the API token from an environment variable (DETERM_API_TOKEN)
2. Authenticates by calling GET /v2/me and prints the user's name and
organization IDs
3. Counts mentions for the last 7 days using POST
/v2/organizations/{orgId}/keywords/{keywordId}/mentions/count with publishedTime.relative =
"LAST_7_DAYS"
4. Scrolls through the first 3 pages of mentions using POST
/v2/organizations/{orgId}/keywords/{keywordId}/mentions/scroll with scrollToken-based
pagination, and prints each mention's title, source type, and sentiment
5. Includes proper error handling with retry logic for 429/5xx errors
(exponential backoff, max 3 retries)
Use organization ID [YOUR_ORG_ID]. Structure the code with separate functions
for each API call. Add comments explaining the key parts.3. Build a dashboard
Use this prompt when you want to create a visual dashboard that shows mention counts, source distribution, and sentiment breakdown.
Build a simple dashboard that uses the Determ API to display media monitoring
data. The dashboard should:
1. Fetch mention counts for the last 30 days using POST
/v2/organizations/{orgId}/keywords/{keywordId}/mentions/count (base URL:
https://api.mediatoolkit.com, auth: Bearer token)
2. Show a breakdown of mentions by source type (WEB vs TWITTER vs FACEBOOK
vs YOUTUBE vs INSTAGRAM vs REDDIT vs TIKTOK) using the typeToCount field
in the response
3. Fetch mentions with sentiment filters to calculate sentiment distribution:
- Count POSITIVE mentions (mentionFilter.sentiment.any = ["POSITIVE"])
- Count NEGATIVE mentions (mentionFilter.sentiment.any = ["NEGATIVE"])
- Count NEUTRAL mentions (mentionFilter.sentiment.any = ["NEUTRAL"])
4. Display the results with charts (bar chart for source types, pie chart
for sentiment)
Use organization ID [YOUR_ORG_ID]. Use [React/Vue/vanilla JS/Python] for the
frontend. Read the API token from an environment variable.4. Debug an issue
Use this prompt when you are getting errors from the Determ API and need help figuring out what is wrong.
I'm getting [describe the error, e.g., "a 400 Bad Request" or "empty
results" or "401 Unauthorized"] when calling the Determ API.
Here's my code:
[Paste your code here]
The endpoint I'm calling is: [e.g., POST
https://api.mediatoolkit.com/v2/organizations/100/keywords/5001/mentions/count]
The request body I'm sending is:
[Paste the request body JSON here]
The response I'm getting is:
[Paste the error response here]
Help me debug this. Check for:
- Correct Authorization header format (should be "Bearer TOKEN")
- Correct Content-Type header (should be "application/json" for POST)
- Valid request body structure (query.publishedTime, query.mentionFilter, etc.)
- Correct path parameter types (organizationId is int64, keywordId is int32)
- Valid enum values (source types, sentiments, time periods)
- Pagination issues (scrollToken handling)5. Write integration tests
Use this prompt when you want to add automated tests to verify your Determ API integration is working correctly.
Write integration tests for the Determ API (base URL:
https://api.mediatoolkit.com, auth: Bearer token from DETERM_API_TOKEN env
var). Use [pytest/Jest/PHPUnit] as the test framework.
Test the following scenarios:
1. GET /v2/me returns user data
- Status code is 200
- Response contains id, email, name, organizationIds
- organizationIds is a non-empty array
2. POST /v2/organizations/{orgId}/keywords/{keywordId}/mentions/count returns counts
- Status code is 200
- Response contains count (integer >= 0) and typeToCount (object)
- Use publishedTime.relative = "LAST_7_DAYS" in the request body
- Use organization ID from the /v2/me response
3. POST /v2/organizations/{orgId}/keywords/{keywordId}/mentions/scroll returns paginated mentions
- Status code is 200
- Response contains mentions (array) and scrollToken (string)
- Each mention has id, type, title, url, autoSentiment fields
- Test pagination: make a second request with the scrollToken and verify
it returns different mentions
4. Error handling
- Test that an invalid token returns 401
- Test that a non-existent organization ID returns 403 or 404
Include setup/teardown to read the API token from environment variables. Add
clear test names that describe what is being tested. Skip tests gracefully if
the environment variable is not set.6. Review my integration code
Use this prompt when you have a working integration and want a thorough code review before shipping it to production.
Review my Determ API integration code for production readiness. Here is the
code:
[Paste your complete integration code here]
Check the following areas:
**Security:**
- Is the API token read from an environment variable (not hardcoded)?
- Is the token excluded from logs and error messages?
- Are there any token leaks in error handling or debug output?
**Error handling:**
- Does it handle 401 (invalid token) gracefully?
- Does it retry on 429 (rate limit) and 5xx (server errors) with
exponential backoff?
- Does it avoid retrying on 400/403/404 (client errors)?
- Is there a maximum retry count?
**Performance:**
- Does it use scrollToken for pagination (not page number incrementing)?
- Does it set a reasonable page size (paged.count)?
- Does it cache responses where possible (e.g., languages, locations)?
**Correctness:**
- Are request bodies structured correctly (query.publishedTime, query.mentionFilter)?
- Are enum values valid (source types, sentiments, time periods)?
- Are ID types correct (organizationId is int64, keywordId is int32)?
- Is Content-Type set to application/json for POST requests?
- Are pagination parameters kept stable across scroll requests?
Provide specific suggestions with code examples for any issues found.