Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.xquik.com/llms.txt

Use this file to discover all available pages before exploring further.

Use Xquik in Pipedream when a workflow needs X (Twitter) search, account lookups, trends, publishing, extraction jobs, monitors, or webhook automation with one API key. Start with a source-available component package. Keep the first release small: one app file, eight actions, and two sources. Add more endpoints after workflows repeatedly fall back to a manual API request.

Prerequisites

  • Xquik API key
  • Pipedream account
  • Node.js 18+
  • Pipedream CLI installed and authenticated
npm install -g @pipedream/cli
pd login

Component Shape

App

components/xquik/app/xquik.app.ts

Auth

API key prop injected as x-api-key.

Base URL

https://xquik.com/api/v1

Actions

Get Tweet, Search Tweets, Get User, Get Trends, Create Tweet, Create Extraction, Create Monitor, and Create Webhook.

Sources

Monitor Event Webhook and Extraction Completed Polling.

Shared helper

JSON requests, structured Xquik errors, and Retry-After handling.

App File

Create the shared app component first:
import { axios } from "@pipedream/platform";

export default {
  type: "app",
  app: "xquik",
  propDefinitions: {
    apiKey: {
      type: "string",
      label: "Xquik API Key",
      secret: true,
    },
  },
  methods: {
    async request($, config, apiKey) {
      return axios($, {
        ...config,
        baseURL: "https://xquik.com/api/v1",
        headers: {
          "content-type": "application/json",
          "x-api-key": apiKey,
          ...(config.headers || {}),
        },
      });
    },
  },
};
Add apiKey: { propDefinition: [xquik, "apiKey"] } to each action and source that calls xquik.request. Use GET /account as the auth smoke test in your first action because it verifies the API key without mutating data.

Shared Error Handling

Wrap requests so every action and source reports the same remediation:
function xquikErrorMessage(status: number, body: unknown, headers: Record<string, string>) {
  if (status === 401) return "Authentication failed. Check the Xquik API key.";
  if (status === 402) return "Subscription or credits required. Update billing in Xquik.";
  if (status === 429) {
    const retryAfter = headers["retry-after"];
    return retryAfter
      ? `Rate limited. Retry after ${retryAfter} seconds.`
      : "Rate limited. Retry after the cooldown period.";
  }
  if (typeof body === "object" && body !== null && "message" in body) {
    return String((body as { message: unknown }).message);
  }
  return "Xquik request failed.";
}
Pipedream actions should call the helper once per request and export a short $summary so the workflow run is scannable.

Starter Actions

Get Tweet

Call GET /x/tweets/{id} and return one tweet.

Search Tweets

Call GET /x/tweets/search and return an array of tweets.

Get User

Call GET /x/users/{id} and return one user.

Get Trends

Call GET /x/trends and return a trend list.

Create Tweet

Call POST /x/tweets and return created tweet metadata.

Create Extraction

Call POST /extractions and return the job ID and status.

Create Monitor

Call POST /monitors and return the monitor ID and status.

Create Webhook

Call POST /webhooks and return the webhook ID and signing secret.
Example Search Tweets action:
import xquik from "../../app/xquik.app";

export default {
  key: "xquik-search-tweets",
  name: "Search Tweets",
  description: "Search recent X posts with Xquik.",
  version: "0.0.1",
  type: "action",
  props: {
    xquik,
    apiKey: { propDefinition: [xquik, "apiKey"] },
    q: { type: "string", label: "Query" },
    limit: { type: "integer", label: "Limit", optional: true, default: 25 },
  },
  async run({ $ }) {
    const data = await this.xquik.request(
      $,
      {
        method: "GET",
        url: "/x/tweets/search",
        params: { q: this.q, limit: this.limit },
      },
      this.apiKey,
    );

    $.export("$summary", `Found ${(data.tweets || []).length} tweets.`);
    return data.tweets || [];
  },
};

Result Handoff

Use Pipedream exports and source event metadata to pass stable fields between workflow steps. Keep raw API pages out of Slack messages, CRM rows, warehouse loads, and retry queues.

Search Tweets action

Export tweet_count, has_next_page, and next_cursor; return tweet rows with id, text, author.username, createdAt, and optional url.

User profile action

Export user_id, username, name, followers, verified, and profilePicture; return one profile row for GET /x/users/{id}.

Trend rows

Export trend_count and woeid; return trend rows with name, rank, query, and description, then keep the selected region with workflow event metadata.

Tweet or reply write

Export tweetId, charged, and chargedCredits on 200 Success. For 202 x_write_unconfirmed, export writeActionId, status, charged, and chargedCredits, then poll GET /x/write-actions/{id} before retrying.

Public media upload

Export mediaId, mediaUrl, and success. Pass mediaUrl to POST /x/tweets in media; reserve uploaded media IDs for one-item DMs.

Monitor and webhook setup

Export monitor id, username, xUserId, eventTypes, isActive, and nextBillingAt; export webhook id, url, eventTypes, and one-time secret. For Pipedream data stores, map production deliveryId to delivery_id for receiver retry de-dupe and streamEventId to stream_event_id when one monitor event should process once across endpoint changes.

Monitor event source

Emit deliveryId for endpoint-level retry de-dupe, streamEventId for event-level de-dupe across endpoint changes, and occurredAt as ts.

Extraction polling source

Emit completed job id, toolType, and status; fetch detail rows and carry hasMore plus nextCursor into warehouse batches.

Source 1: Monitor Event Webhook

Use this for immediate tweet, reply, quote, and retweet alerts. Setup flow:
  1. Pipedream creates an HTTP endpoint for the source.
  2. The source calls POST /webhooks with that endpoint and selected event types.
  3. The user creates or selects an Xquik monitor.
  4. Each webhook payload emits one event with a stable ID.
Payload mapping:

Event ID

Map Pipedream id to streamEventId for event-level de-dupe, or deliveryId for endpoint-level de-dupe.

Event Type

Map eventType to route tweet.new, tweet.reply, tweet.quote, and tweet.retweet events.

Occurred At

Map occurredAt as the event timestamp.

Username

Map username for account monitor events.

Tweet ID

Map data.id as the tweet identifier.

Text

Map data.text as the tweet body.

Author Username

Map data.author.userName when present. Use username as the monitored-account fallback.
Keep the webhook secret returned by Xquik and verify x-xquik-signature before emitting events.

Source 2: Extraction Completed Polling

Use this when teams want batch jobs without webhook setup.
export default {
  key: "xquik-extraction-completed",
  name: "Extraction Completed",
  description: "Emit completed Xquik extraction jobs.",
  version: "0.0.1",
  type: "source",
  props: {
    xquik,
    apiKey: { propDefinition: [xquik, "apiKey"] },
    timer: { type: "$.interface.timer", default: { intervalSeconds: 900 } },
  },
  async run() {
    const data = await this.xquik.request(
      this,
      {
        method: "GET",
        url: "/extractions",
        params: { status: "completed", limit: 25 },
      },
      this.apiKey,
    );

    for (const job of data.extractions || []) {
      this.$emit(job, {
        id: job.id,
        summary: `Extraction ${job.id} completed`,
        ts: Date.parse(job.completedAt || job.updatedAt || job.createdAt),
      });
    }
  },
};

Recipes

Search Tweets To Slack

Schedule Trigger

Run the workflow on the reporting cadence.

Xquik Search Tweets

Call the Search Tweets action and return recent matching posts.

Engagement Filter

Keep only tweets that meet the minimum engagement threshold.

Slack Send Message

Send the selected tweet text, author, and link to the channel.

Monitor Events To CRM

Monitor Event Source

Receive Xquik monitor events from the webhook source.

Event Type Filter

Route tweet.new, tweet.reply, tweet.quote, and tweet.retweet events separately.

Get User Enrichment

Enrich the event with the Get User action before CRM routing.

CRM Upsert

Upsert by user ID to avoid duplicate account records.

Extraction To Warehouse

Create Extraction

Start the extraction job with POST /extractions.

Extraction Completed Source

Poll for completed jobs before loading rows downstream.

Fetch Extraction Detail

Fetch the completed extraction detail and result rows.

Warehouse Destination

Send normalized rows to the warehouse destination.

Test Coverage

Add focused tests before sharing the component package:

Auth Injection

Every request includes x-api-key and never logs the key.

Invalid Key

401 produces “Authentication failed. Check the Xquik API key.”

Rate Limit

429 includes Retry-After when present.

Search Action

Returns an array with stable tweet IDs.

Create Webhook

Sends callback URL and selected event types.

Webhook Source

Emits one event per payload with a stable ID.

Polling Source

Emits only completed extraction jobs.
Run component tests and publish privately first:
npm test
pd publish components/xquik/actions/search-tweets/search-tweets.ts

Next Steps

Last modified on May 18, 2026