agentleFS
TikHubTikHub/tikhub-plugin/skills/bulk-data-export/SKILL.md

bulk-data-export

Skill7 starsChanged 5 months agoMITView on GitHub

Fetch large lists from TikHub (posts, followers, search results, comments) with safe pagination, dedup, and export to CSV or JSON for downstream analysis. Use when the user wants "all posts", "export to CSV/JSON", "scrape N results", "a dataset of", or any large repeated-pull job.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the platform's cursor (max_cursor / pagination_token / continuation_token / cursor / cursor+index) — see tikhub-rest-api and the …

    line 32
  2. Distinctive:

    Add a short delay / concurrency cap ≤4 (QPS 10/sec).

    line 35
  3. Very specific:

    JSON: write the deduped array to output.json.

    line 40
  4. Distinctive:

    No duplicate ids in the output.

    line 48

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Bulk Data Export

Paginate a list endpoint at scale, dedup, and write a clean dataset — safely and with a cost estimate up front.

Setup gate

[ -z "${TIKHUB_API_KEY:-}" ] && echo "Set TIKHUB_API_KEY first (see tikhub-onboarding)."

Step 1 — Estimate cost FIRST (mandatory)

Bulk pulls are the biggest credit spender. Before fetching:

# pages = ceil(target_rows / page_size)
curl -s "https://api.tikhub.io/api/v1/tikhub/user/calculate_price?endpoint=<ENDPOINT_PATH>&request_per_day=<PAGES>" \
  -H "Authorization: Bearer $TIKHUB_API_KEY"
curl -s "https://api.tikhub.io/api/v1/tikhub/user/get_user_daily_usage" -H "Authorization: Bearer $TIKHUB_API_KEY"

State the estimated calls + cost and get the user's go-ahead before running.

Step 2 — Paginate safely

  • Use the platform's cursor (max_cursor / pagination_token / continuation_token / cursor / cursor+index) — see tikhub-rest-api and the platform skill.
  • Loop until has_more is false or the user's target row count is reached (hard cap).
  • Add a short delay / concurrency cap ≤4 (QPS 10/sec). Retry transient 429/5xx with backoff.
  • Dedup by stable id (e.g. aweme_id / post id) as you go.

Step 3 — Export

  • JSON: write the deduped array to output.json.
  • CSV: flatten the fields the user cares about (id, author, text, likes, comments, shares, timestamp, url) into output.csv.
  • Report row count, pages fetched, duplicates removed, and the file path.

Verification gate

  1. Row count ≈ requested (note if the source ran out early).
  2. No duplicate ids in the output.
  3. File written and non-empty; CSV header matches columns.

Red flags

  • Skipping the cost estimate — never start a bulk pull without one.
  • Ignoring the user's row cap / has_more (infinite loop, credit burn).
  • Silent truncation — always report how many rows were actually fetched vs. requested.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.