feat(api): add GET /v1/activity endpoint for listing recent jobs#3160
Open
firecrawl-spring[bot] wants to merge 4 commits intomainfrom
Open
feat(api): add GET /v1/activity endpoint for listing recent jobs#3160firecrawl-spring[bot] wants to merge 4 commits intomainfrom
firecrawl-spring[bot] wants to merge 4 commits intomainfrom
Conversation
Adds a new endpoint that lets users list their recent API activity (last 24 hours) with cursor-based pagination. This enables users to discover job IDs for past scrapes, crawls, batch scrapes, etc. so they can retrieve results via existing GET endpoints. Co-Authored-By: micahstairs <micah@sideguide.dev>
3 tasks
Contributor
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/api/src/controllers/v1/activity.ts">
<violation number="1" location="apps/api/src/controllers/v1/activity.ts:19">
P2: Add `browser` to `VALID_KINDS`; the current filter rejects a real activity kind.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
- Remove ZDR 403 check (not needed for metadata-only endpoint) - Add new RateLimiterMode.Account (100 req/min) for all account endpoints instead of reusing CrawlStatus - Rename query param from next_cursor to cursor Co-Authored-By: micahstairs <micah@sideguide.dev>
Contributor
There was a problem hiding this comment.
2 issues found across 5 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/api/src/controllers/v1/activity.ts">
<violation number="1" location="apps/api/src/controllers/v1/activity.ts:66">
P1: Read `next_cursor` from the query string so the returned pagination token can be used for the next page.</violation>
</file>
<file name="apps/api/src/routes/v1.ts">
<violation number="1" location="apps/api/src/routes/v1.ts:287">
P2: Switching these read endpoints to `RateLimiterMode.Account` sharply reduces their allowed request rate, so existing polling/usage clients can start getting unexpected 429s.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
This comment has been minimized.
This comment has been minimized.
- Bump Account rate limit from 100 to 1000 req/min - Add 'browser' to VALID_KINDS for activity filtering - Remove origin and integration from activity response Co-Authored-By: micahstairs <micah@sideguide.dev>
Contributor
There was a problem hiding this comment.
2 issues found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/api/src/controllers/v1/activity.ts">
<violation number="1" location="apps/api/src/controllers/v1/activity.ts:74">
P2: This drops `origin` and `integration` from `/v1/activity`, so the implementation no longer matches the documented response schema.</violation>
</file>
<file name="apps/api/src/services/rate-limiter.ts">
<violation number="1" location="apps/api/src/services/rate-limiter.ts:32">
P2: This raises the default Account limiter to 1000 req/min instead of the intended 100 req/min, weakening protection for account-scoped endpoints when no explicit account limit is present.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
- Rename `kind` query param and response field to `endpoint` for clarity - Rename `next_cursor` response field to `cursor` to match the query param Co-Authored-By: micahstairs <micah@sideguide.dev>
Contributor
There was a problem hiding this comment.
2 issues found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/api/src/controllers/v1/activity.ts">
<violation number="1" location="apps/api/src/controllers/v1/activity.ts:51">
P2: The endpoint now reads `endpoint` instead of the documented `kind` query param, so clients using `?kind=...` won’t get filtered results.</violation>
<violation number="2" location="apps/api/src/controllers/v1/activity.ts:103">
P2: Response fields were renamed to `endpoint` and `cursor`, but the documented API uses `kind` and `next_cursor`. This is a breaking change for clients expecting the documented shape.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /v1/activityendpoint that lists a team's recent API activity (last 24 hours)endpoint(scrape, crawl, batch_scrape, search, extract, etc.)id,endpoint,api_version,created_at,targetrequeststable directly using the existing(team_id, created_at DESC)indexMotivation
Customers who lose local data (machine crash, etc.) currently have no way to discover job IDs to re-download results from past scrapes/crawls. This endpoint enables discovery of recent job IDs, which can then be used with existing GET endpoints (
/v1/crawl/{id},/v1/batch/scrape/{id},/v1/scrape/{id}, etc.) to retrieve results.API
{ "success": true, "data": [ { "id": "01958abc-...", "endpoint": "crawl", "api_version": "v1", "created_at": "2026-03-13T16:04:08Z", "target": "https://example.com" } ], "cursor": "01958aaa-...", "has_more": true }Test plan
GET /v1/activityreturns recent jobs for the authenticated teamcursorfrom first page works for second pageendpointfilter:?endpoint=crawlonly returns crawl jobslimitparam: respects limit, caps at 100idvalues work with existing GET endpoints (e.g./v1/crawl/{id})