본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)260k · #578

har-derived-api-client

하는 일

이 스킬은 브라우저가 웹사이트를 쓰는 동안 네트워크 활동을 관찰하고, 그 기록을 사이트의 데이터를 직접 호출하는 간단한 클라이언트로 바꿉니다. 공개 API가 없는 사이트를 자동화해야 하는 개발자를 위한 것입니다.

사용하는 경우

  • ✓공개 API는 없지만 JSON으로 데이터를 불러오는 웹사이트의 클라이언트가 필요할 때.
  • ✓AI가 같은 브라우저 단계를 여러 번 반복하려고 하며, 직접 요청이 더 빠를 때.
  • ✓웹사이트가 쓰는 자동 완성이나 검색 기능을 자동화하고 싶을 때.

스킬 링크

https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/web-development/har-derived-api-client/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/web-development/har-derived-api-client/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 사이트의 매물을 직접 검색하는 작은 클라이언트를 만들어 주세요. 매번 페이지를 클릭하지 않아도 되게 해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 브라우저 네트워크 트래픽을 HAR 파일에 기록한 뒤, 페이지가 쓰는 엔드포인트를 추출합니다. AI는 일반 HTTP 도구로 그 요청을 재현하고, 이미 가진 로그인 세션이 있으면 그것을 이어받습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

HAR-Derived API Client

Drive a website once with a real browser while recording its network traffic to a HAR file, then distill that HAR into the site's private JSON API so you can call it directly with plain HTTP — far cheaper and faster than browser-controlling the page on every request. Credit: trick by Jared Longster, popularized by Dax (thdxr). This captures and replays; it does NOT bypass auth, solve CAPTCHAs, or defeat bot-detection — if the site needs a logged-in session, you carry its headers/cookies forward, you don't forge them.

The scripts are stdlib-plus-Playwright: capture needs Playwright, derivation is pure stdlib, replay needs only requests/httpx (or curl).

Covers every Hermes browser pathway: the default local Chromium that browser_exec drives, plus the cloud/remote backends (Browserbase, Browser-Use, Firecrawl) and any /browser connect CDP endpoint. There are two capture scripts — one for a browser you launch, one for a browser you attach to over CDP — because HAR recording works differently in each case (see How to Run).

When to Use

  • "Build a CLI/client for <website>" — derive its API instead of scripting clicks.
  • "This site has no public API but the page clearly fetches JSON."
  • You're about to loop browser_exec navigations for the same query repeatedly — stop and derive the endpoint once.
  • Reverse-engineering an autocomplete, search, feed, or checkout XHR.
  • You captured a session on a cloud backend (Browserbase / Browser-Use / Firecrawl) or via /browser connect and want the API without re-renting the browser.

Prerequisites

  • Playwright + a browser binary (capture step only):
    • pip install playwright then playwright install chromium --no-shell
    • (If a system Playwright already has browsers under ~/.cache/ms-playwright, reuse it.)
  • requests or httpx for the replay step (stdlib urllib also works).
  • No API keys. Any keys/tokens the client needs are the ones the HAR captured.
  • For the CDP path (har_capture_cdp.py): a reachable CDP endpoint. On Hermes, run /browser connect to print the active endpoint, or read BROWSER_CDP_URL / browser.cdp_url in config. Cloud backends expose it as cdpUrl/connectUrl.

How to Run

Scripts under this skill's scripts/, invoked through the terminal tool. Pick the capturer by pathway — this is the part that trips people up:

Browser pathway How Hermes reaches it Capturer
Local Chromium (default browser_exec browser) launched locally har_capture.py
Browserbase / Browser-Use / Firecrawl (cloud) CDP (cdpUrl) har_capture_cdp.py
/browser connect <url> / BROWSER_CDP_URL CDP har_capture_cdp.py

Rule of thumb: if Hermes launched the browser, use har_capture.py; if it connected to one over CDP, use har_capture_cdp.py. har_capture.py uses Playwright's record_har_path, which only works on a locally-owned context. har_capture_cdp.py attaches with connect_over_cdp() and assembles the HAR from page.on("request"/"response") events, because record_har_path is unavailable on a connected browser.

Then, for either path:

  • har_to_client.py — filters the HAR to XHR/fetch/JSON, groups by endpoint, and prints params, headers, bodies, and replay hints (User-Agent / cookie / auth).

Resolve paths against this skill's directory. Canonical loop:

# 1a. Capture, LOCAL browser (Hermes launched it)
python3 scripts/har_capture.py "https://SITE/" out.har \
  --action "fill:input[name=search]:my query" --action "sleep:3" --wait 2

# 1b. Capture, CDP browser (cloud backend or /browser connect)
#     get the endpoint from /browser connect or BROWSER_CDP_URL
python3 scripts/har_capture_cdp.py "ws://HOST/devtools/browser/..." out.har \
  --goto "https://SITE/" --action "fill:input[name=search]:my query" \
  --action "sleep:3" --wait 2

# 2. Derive — read the endpoints out of the HAR
python3 scripts/har_to_client.py out.har --host SITE --max-body 400

# 3. Replay — write a tiny client from the printed endpoint (see Procedure)

Quick Reference

har_capture.py <url> <out.har> [--wait S] [--headed] [--action SPEC ...]
  action SPEC:  fill:SELECTOR:TEXT | press:SELECTOR:KEY | click:SELECTOR
                goto:URL | sleep:SECONDS      (run in order after page load)
  use when Hermes LAUNCHED the browser (local browser_exec default)

har_capture_cdp.py <cdp_url> <out.har> [--goto URL] [--wait S] [--action SPEC ...]
  sa
자주 묻는 질문

로그인이나 CAPTCHA를 우회하나요?

아니요. 스킬은 인증을 우회하거나 CAPTCHA를 풀거나 봇 탐지를 무력화하지 않는다고 말합니다.

어떤 브라우저에서 작동하나요?

스킬은 로컬 Chromium 브라우저와 클라우드 또는 원격 브라우저 백엔드를 다루며, 두 개의 캡처 스크립트를 씁니다.

캡처를 실행하려면 무엇이 필요한가요?

캡처에는 Playwright가 필요하며, 파생과 재현 단계는 표준 Python이나 curl만 있으면 됩니다.

상세 정보

작성자의 원본 설명

Record a site's XHR into a HAR, derive an HTTP client.

repo: NousResearch/hermes-agent

인기도

GitHub 스타
260k
순위
#578
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬