Skip to content

Add TwittrAPI as a provider API for X/Twitter data - #7626

Closed
twittrapi wants to merge 2 commits into
BuilderIO:mainfrom
twittrapi:add-twittrapi-provider
Closed

twittrapi wants to merge 2 commits into
BuilderIO:mainfrom
twittrapi:add-twittrapi-provider

Conversation

@twittrapi

@twittrapi twittrapi commented Oct 15, 2026 •

Copy link
Copy Markdown

Disclosure: I work on TwittrAPI.

What

Adds TwittrAPI as a built-in provider API for X/Twitter data, next to the existing twitter provider (twitterapi.io), so agents and the analytics template can use either one.

  • twittrapi in PROVIDER_API_IDS and PROVIDER_CONFIGS: api-key-header auth with TWITTRAPI_API_KEY sent as X-API-KEY, base https://api.twittrapi.com, the OpenAPI spec in specUrls for docs lookup, and examples for user lookup, user tweets and search (format=simple returns flat camelCase JSON in a {data, nextCursor, previousCursor, hasNextPage} envelope).
  • Analytics template: a twittrapi data source with setup steps.
  • Eject manifest and provider-api-definitions.ts, integrations docs, docs/environment-variables.md and the credential guard list the new key.
  • Changeset: @agent-native/core patch.

Testing

  • packages/core: vitest run src/package-lifecycle/eject-manifest-repo.spec.ts src/provider-api src/eject (14 files, 266 tests) pass after building the workspace packages.
  • templates/analytics: the data-source status and MCP exclusion specs pass.
  • node scripts/guard-no-env-credentials.mjs is clean, oxfmt --check passes on the changed files.

Something I noticed while reading the code (not changed here)

The existing X / Twitter data source in templates/analytics/app/lib/data-sources.ts tells users to create an app in the X Developer Portal and paste its Bearer Token, but templates/analytics/server/handlers/twitter.ts and the twitter provider send that value as X-API-Key to api.twitterapi.io. An X bearer token won't authenticate there, so users who follow those steps get errors. The steps probably want to point at a twitterapi.io API key instead. Happy to send that as a separate PR if you'd like.

Thanks for considering it. If you'd rather not ship a second Twitter provider, a pointer to the preferred route (custom provider registry, community template) would be great too.

Adds a twittrapi provider next to the existing twitterapi.io one: API key
in the X-API-KEY header (TWITTRAPI_API_KEY), base https://api.twittrapi.com,
OpenAPI spec for docs lookup, and examples for user lookup, user tweets and
search. The analytics template lists it as a data source, and the eject
manifest, docs and credential guard list the new key.

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder reviewed your changes and found 2 potential issues 🔴

Review Details

Code Review Summary

PR #7626 registers TwittrAPI as a second X/Twitter provider, adds its API-key auth, OpenAPI documentation and endpoint examples, exposes it through the analytics template, and updates eject metadata, docs, and the credential guard. The core provider definition is small and follows the existing registry pattern; the API base URL and X-API-KEY configuration and eject entries were confirmed consistent. Risk: Standard.

Key findings

  • 🔴 HIGH — The Analytics walkthrough collects TWITTRAPI_API_KEY, but that key is missing from Analytics’ runtime credential registry. Saving it is rejected and configured status cannot recognize it.
  • 🟡 MEDIUM — Analytics has no twittrapi test-connection handler, so its Test connection action returns “Unknown source”.
  • 🟡 LOW — The pagination guidance says the response has a cursor field, while the upstream simple response uses nextCursor and related fields.

The provider API registration and auth wiring are otherwise consistent with the existing provider pattern. 🧪 Browser testing: Will run after this review (PR touches UI code).

Comment on lines +879 to +885
id: "twittrapi",
name: "TwittrAPI",
description:
"X/Twitter tweets, profiles, followers and search through the TwittrAPI REST API, no X developer account needed",
category: "communication",
icon: IconBrandX,
envKeys: ["TWITTRAPI_API_KEY"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 TwittrAPI credential is rejected by Analytics credential storage

The walkthrough collects TWITTRAPI_API_KEY, but Analytics only accepts keys registered in server/lib/credential-keys.ts; its credential-save action filters submissions against that registry and rejects an unrecognized key. Register the key (and provider status metadata as needed) so users can save it and see the source as configured.

Fix in Builder

],
},
{
id: "twittrapi",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 TwittrAPI connection test always reports an unknown source

The Analytics Test connection action passes this source ID to the server handler, which has no twittrapi case and returns Unknown source by default. Add a TwittrAPI-specific connection check so users can verify the integration with a valid key.

Fix in Builder

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder reviewed your changes and found 1 potential issue 🟡

Review Details

Incremental Code Review Summary

The latest PR head updates TwittrAPI pagination guidance: it now names nextCursor, previousCursor, and hasNextPage, and explains how to request another page. The earlier report's incorrect cursor-field names are therefore fixed. This update is still a Standard-risk provider integration. The credential-save and Analytics Test connection findings from the prior review remain unchanged and unresolved; I did not repost them.

New finding

  • 🟡 MEDIUM — The new guidance describes the simple response envelope as if cursor fields were generally present, but single-result endpoints such as user-by-username return no pagination fields. Scope the envelope to paginated endpoints and make clear that pagination fields apply when using format=simple.

The provider registration and auth wiring otherwise remain consistent. 🧪 Browser testing: Skipped — the browser-test-planner agent is unavailable; this incremental change only updates provider guidance.

Comment on lines +1769 to +1770
"Read endpoints for tweets, users, followers, search, lists and communities. Add format=simple for flat camelCase JSON in a {data, nextCursor, previousCursor, hasNextPage} envelope.",
"While hasNextPage is true, pass nextCursor back as the cursor query parameter for the next page.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Pagination envelope guidance overgeneralizes cursor fields

The guidance presents {data, nextCursor, previousCursor, hasNextPage} as the simple response envelope generally, but single-result endpoints such as /user/by/username/{username} return only {data}. Scope the cursor-envelope guidance to paginated endpoints and explicitly tie the cursor instructions to format=simple, so agents do not expect pagination fields on lookup responses or raw-format results.

Fix in Builder

Copy link
Copy Markdown
Contributor

Thanks for the integration and clear disclosure. I still see three follow-ups before this can move forward: (1) register TWITTRAPI_API_KEY in Analytics credential-save handling so setup persists it; (2) add a TwittrAPI case to the Analytics test-connection path; and (3) scope the pagination fields in the docs to paginated endpoints, since single-result user lookup does not return them. Separately, adding a second X/Twitter provider needs product-owner sign-off on whether TwittrAPI belongs in the built-in catalog. Please hold off on merge until that decision and the implementation follow-ups are resolved.

@steve8708

Copy link
Copy Markdown
Contributor

Apologies @twittrapi that prior message was sent from a bot - for now I want to try to keep the provider list as curated as possible to reduce our maintenance load. Going to close this out for now but if people start asking for TwittrAPI happy to take a second look

@steve8708 steve8708 closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants