Resolve a user, fetch their latest post, and list its reposters.
Chains the username lookup endpoint into the user-posts endpoint and then the reposted-by endpoint, branching to a no-op end when the user has no posts.
arazzo: 1.0.1
info:
title: X List Who Reposted a Handle's Latest Post
summary: Resolve a handle, get their latest post, then list who reposted it.
description: >-
Produces a repost audit for an X account. The workflow resolves a username
to an id, retrieves that user's single most recent post, and then lists the
users who reposted that post. Each step inlines its field selections so the
chain reads and executes without opening the underlying OpenAPI description.
version: 1.0.0
sourceDescriptions:
- name: tweetsApi
url: ../openapi/twitter-tweets-api-openapi.yml
type: openapi
- name: usersApi
url: ../openapi/twitter-users-api-openapi.yml
type: openapi
workflows:
- workflowId: reposters-of-latest-post
summary: Resolve a user, fetch their latest post, and list its reposters.
description: >-
Chains the username lookup endpoint into the user-posts endpoint and then
the reposted-by endpoint, branching to a no-op end when the user has no
posts.
inputs:
type: object
required:
- username
properties:
username:
type: string
description: The @username to audit, without the leading @.
authorization:
type: string
description: Bearer token to authorize the requests (e.g. "Bearer xxx").
steps:
- stepId: resolveUser
description: Resolve the username into a numeric user id.
operationId: getUsersByUsername
parameters:
- name: username
in: path
value: $inputs.username
- name: user.fields
in: query
value: id,name,username
- name: Authorization
in: header
value: $inputs.authorization
successCriteria:
- condition: $statusCode == 200
outputs:
userId: $response.body#/data/id
- stepId: latestPost
description: Retrieve the single most recent original post for the resolved user.
operationId: getUsersPosts
parameters:
- name: id
in: path
value: $steps.resolveUser.outputs.userId
- name: max_results
in: query
value: 5
- name: exclude
in: query
value: replies,retweets
- name: tweet.fields
in: query
value: id,text,public_metrics
- name: Authorization
in: header
value: $inputs.authorization
successCriteria:
- condition: $statusCode == 200
outputs:
latestPostId: $response.body#/data/0/id
onSuccess:
- name: hasPosts
type: goto
stepId: repostedBy
criteria:
- context: $response.body
condition: $.data.length > 0
type: jsonpath
- name: noPosts
type: end
criteria:
- context: $response.body
condition: $.data.length == 0
type: jsonpath
- stepId: repostedBy
description: List the users who reposted the resolved user's latest post.
operationId: getPostsRepostedBy
parameters:
- name: id
in: path
value: $steps.latestPost.outputs.latestPostId
- name: max_results
in: query
value: 100
- name: user.fields
in: query
value: id,name,username
- name: Authorization
in: header
value: $inputs.authorization
successCriteria:
- condition: $statusCode == 200
outputs:
reposters: $response.body#/data
resultCount: $response.body#/meta/result_count
outputs:
userId: $steps.resolveUser.outputs.userId
latestPostId: $steps.latestPost.outputs.latestPostId
reposters: $steps.repostedBy.outputs.reposters
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.