Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: endpoint to get metrics of casts matching a query #271

Merged
merged 5 commits into from
Dec 24, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions src/v2/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
security:
- ApiKeyAuth: []

components:

Check warning on line 18 in src/v2/spec.yaml

View workflow job for this annotation

GitHub Actions / Validate and Lint OpenAPI Specs

unused-components All components must be referenced.
securitySchemes:
ApiKeyAuth:
type: apiKey
Expand Down Expand Up @@ -2614,6 +2614,31 @@
$ref: "#/components/schemas/CastWithInteractions"
next:
$ref: "#/components/schemas/NextCursor"
CastsMetrics:
type: object
required:
- start
- resolution_in_seconds
- cast_count
properties:
start:
type: string
format: date-time
resolution_in_seconds:
type: integer
format: int32
cast_count:
type: integer
format: int32
CastsMetricsResponse:
type: object
required:
- metrics
properties:
metrics:
type: array
items:
$ref: "#/components/schemas/CastsMetrics"
FeedResponse:
type: object
required:
Expand Down Expand Up @@ -5326,6 +5351,55 @@
$ref: "#/components/schemas/CastsSearchResponse"
"400":
$ref: "#/components/responses/400Response"
/farcaster/cast/metrics:
get:
tags:
- Cast
summary: Metrics for casts
description: Fetches metrics casts matching a query
externalDocs:
url: https://docs.neynar.com/reference/fetch-cast-metrics
operationId: fetch-cast-metrics
parameters:
- name: q
in: query
required: true
description: "Query string to search for casts"
example: "star wars"
schema:
type: string
- name: interval
in: query
required: false
description: "Interval of time for which to fetch metrics. Choices are `1d`, `7d`, `30d`"
schema:
type: string
enum:
- 1d
- 7d
- 30d
- name: author_fid
in: query
required: false
description: "Fid of the user whose casts you want to search"
example: 194
schema:
$ref: "#/components/schemas/Fid"
- name: channel_id
in: query
required: false
schema:
type: string
description: "Channel ID of the casts you want to search"
responses:
"200":
description: Successful operation.
content:
application/json:
schema:
$ref: "#/components/schemas/CastsMetricsResponse"
"400":
$ref: "#/components/responses/400Response"
/farcaster/cast/conversation:
get:
tags:
Expand Down
Loading