Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ui-json-capture

БесплатноЗапускает вложенные скриптыНе проверен

Use when the user asks to 'scrape Lex Machina', 'capture Bloomberg Law results', 'get all the search results', 'export more than the row cap', 'the export…

edwinhuот edwinhu★ 28 звёзд на GitHub

Об этом скилле

Capturing paginated JSON from an authenticated research UI

What this skill carries — grep references/ for any subject the names below miss: !d=${CLAUDE_SKILL_DIR}; command -v skill-toc >/dev/null 2>&1 && exec skill-toc "$d"; s=$HOME/.claude/skills/plugin-utils/bin/skill-toc; [ -x "$s" ] && exec "$s" "$d"; echo "(skill-toc unavailable: references and scripts are NOT listed here — install the plugin-utils plugin, or start a new session so its bin/ reaches PATH)"

Drive the user's logged-in browser over CDP, hook XMLHttpRequest, click through the result pages, and keep the JSON the page already received. No direct API calls, no credential handling, no fighting the export cap.

Decide the access route BEFORE touching anything

## The Iron Law of Terms of Service

Systematic capture of a paid research corpus is the user's decision to make knowingly, not yours to slide into. Surface the trade-off once, in plain terms, then do what they decide.

LexisNexis, Bloomberg and Thomson Reuters terms prohibit systematic downloading; the export row cap is that prohibition's enforcement mechanism, and paging the XHR endpoint routes around it. The exposure — account termination, an institutional licence, a research programme — lands on the user, not on you.

Say it once and move on. Repeating it after they decide is not caution, it is nagging, and it wastes the turn they already spent answering.

Two routes make the question moot and are worth naming in the same breath, because they are often available and nobody thinks of them: these vendors sell API access as a contract line, and they grant academic bulk agreements. Either produces a citable, reproducible dataset. A scrape does not.

Check whether you need to page at all

A single response usually carries the facet counts. Before capturing 667 pages to count things, read the facets in page one. The Lex Machina response that answered "how many derivative suits are there" carried de-dcc-case_tag (12 terms), de-dcc-case_type (15 terms) and a filed_on year histogram — every count the question needed, from one ordinary page load.

Then check whether a filtered slice fits under the export cap. Lex Machina caps exports at 1,000 rows, but annual filings ran 932–1,510, so year-by-year exports were under the cap for every year but one. Fourteen sanctioned exports beat one unsanctioned scrape.

Page only when you need per-record fields across a population that will not slice under the cap.

Procedure

Load the browser-automation skill first — it owns port/prefix selection. Use the interactive browser (9222 / mcp__chrome-devtools__* on Linux), because the session must be logged in.

  1. Find the JSON. With the results page open, list_network_requests filtered to xhr/fetch, then get_network_request on the one whose response is application/json. Often it is the same URL as the page, differing only by an X-Requested-With: XMLHttpRequest request header. Save the body with responseFilePath and read its shape — you need the array field, the offset field, the total, and the page size.
  2. Install the hook — scripts/01-install-hook.js, after editing the three site-specific lines it flags (URL test, array field, offset field).
  3. Smoke-test 4 pages before committing to the run. Confirm offsets advance and errors is empty.
  4. Start the pager — scripts/02-run-pager.js. It returns immediately by design.
  5. Poll and drain — scripts/03-status.js to check, scripts/04-dump.js to write a batch, passing filePath. Drain every few hundred pages.
  6. Stop — scripts/05-stop.js, or let it end on the disabled Next button.
  7. Assemble and prove it — scripts/assemble.py. Its non-zero exit is the gate.
python3 "${CLAUDE_SKILL_DIR}/scripts/assemble.py" \
  --batches scratch/capture --glob 'batch_*.json' --out data/raw/cases.jsonl \
  --expect-total 16670 --page-size 25 --id-field id --first-page scratch/page0.json

Capture Facts

  • evaluate_script dies at the CDP protocolTimeout (~120 s) but the in-page loop keeps running. A 50-page awaited batch returned Runtime.callFunctionOn timed out while the page went on to capture 20 more. Awaiting a long loop therefore reports failure for work that succeeded — you lose the return value, not the data. Detach and poll; that is why 02-run-pager.js returns immediately.
  • Route the payload to disk with filePath, never through the return value. 16,670 records was 258 MB. Returning that inline would blow the context window for zero benefit — the model never needs to see the rows, only the integrity counts.
  • filePath is restricted to configured workspace roots. A path under a symlinked data directory resolving outside them fails with Access denied … not within any of the configured workspace roots. Write into the repo (e.g. `scra
Полный SKILL.md на GitHub

Установить ui-json-capture в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

scripts/01-install-hook.jsscripts/02-run-pager.jsscripts/03-status.jsscripts/04-dump.jsscripts/05-stop.jsscripts/assemble.pyscripts/assemble_test.py

FAQ

Что делает скилл ui-json-capture?

Use when the user asks to 'scrape Lex Machina', 'capture Bloomberg Law results', 'get all the search results', 'export more than the row cap', 'the export only gives me 1,000', 'pull the whole docket', 'grab every page of results', 'capture the JSON behind this page', 'page through this site and save the data', or wants the full result set out of an authenticated research UI (Lex Machina, Bloomberg Law, Westlaw, Docket Alarm, UniCourt) whose export is capped or absent. Also use when a site's results are clearly JSON-backed but there is no documented API.

Как установить скилл ui-json-capture?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ui-json-capture запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить ui-json-capture с