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

SurfaceInitial scope
Appcomponents/xquik/app/xquik.app.ts
AuthAPI key prop injected as x-api-key
Base URLhttps://xquik.com/api/v1
ActionsGet Tweet, Search Tweets, Get User, Get Trends, Create Tweet, Create Extraction, Create Monitor, Create Webhook
SourcesMonitor Event Webhook, Extraction Completed Polling
Shared helperJSON requests, structured Xquik errors, 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

ActionMethod and pathOutput
Get TweetGET /x/tweets/{id}One tweet
Search TweetsGET /x/tweets/searchArray of tweets
Get UserGET /x/users/{id}One user
Get TrendsGET /x/trendsTrend list
Create TweetPOST /x/tweetsCreated tweet metadata
Create ExtractionPOST /extractionsJob ID and status
Create MonitorPOST /monitorsMonitor ID and status
Create WebhookPOST /webhooksWebhook ID and 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 || [];
  },
};

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:
Pipedream fieldXquik payload field
idstreamEventId or deliveryId
eventTypeeventType
occurredAtoccurredAt
usernameusername
tweetIddata.id
textdata.text
authorUsernamedata.author.userName
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

StepPipedream component
1Schedule trigger
2Xquik Search Tweets
3Filter by minimum engagement
4Slack Send Message

Monitor Events To CRM

StepPipedream component
1Xquik Monitor Event Webhook source
2Filter by eventType
3Enrich with Get User
4CRM upsert by user ID

Extraction To Warehouse

StepPipedream component
1Xquik Create Extraction
2Xquik Extraction Completed source
3Fetch extraction detail
4Send rows to the warehouse destination

Test Coverage

Add focused tests before sharing the component package:
TestExpected assertion
Auth injectionEvery request includes x-api-key and never logs the key
Invalid key401 produces “Authentication failed. Check the Xquik API key.”
Rate limit429 includes Retry-After when present
Search actionReturns an array with stable tweet IDs
Create webhookSends callback URL and selected event types
Webhook sourceEmits one event per payload with a stable ID
Polling sourceEmits 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