Skill Tracer
Skills › Scientific Agent Skills › exa-search › web-extract.md

web-extract.md

74 lines · skills/exa-search/references/web-extract.md at 5f2bc03

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# URL Extraction
2
3Extract content from: $ARGUMENTS
4

URL Extraction

Extract content from: $ARGUMENTS

Raw lines 1 to 4
5## Command
6
7Choose a short, descriptive filename based on the URL or content (e.g., `alphafold-paper`, `nature-editorial`). Use lowercase with hyphens, no spaces.
8
9```bash
10uv run "$SKILL_PATH/scripts/exa_extract.py" "$ARGUMENTS" \
11 --text \
12 -o "$FILENAME.json"
13```
15You can pass up to 100 URLs as positional arguments in one `/contents` call. Split larger lists into separate invocations; the wrapper rejects oversized batches.
17Content modes:
19- `--text` (default if nothing else is passed) returns full-text content
20- `--highlights` returns extracted passages instead of full text

Command

Choose a short, descriptive filename based on the URL or content (e.g., alphafold-paper, nature-editorial). Use lowercase with hyphens, no spaces.

uv run "$SKILL_PATH/scripts/exa_extract.py" "$ARGUMENTS" \
  --text \
  -o "$FILENAME.json"

You can pass up to 100 URLs as positional arguments in one /contents call. Split larger lists into separate invocations; the wrapper rejects oversized batches.

Content modes:

  • --text (default if nothing else is passed) returns full-text content
  • --highlights returns extracted passages instead of full text
Raw lines 5 to 21
Runs code scripts/exa_extract.py :10
22## Academic content handling
24When extracting from academic sources (arXiv, PubMed, journal sites, conference proceedings), use `--text` to request the page text:
26```bash
27uv run "$SKILL_PATH/scripts/exa_extract.py" "$URL" \
28 --text \
29 -o "$FILENAME.json"
30```
32For arXiv, `/abs/` is an abstract/metadata page; it is not proof that the full
33paper was extracted. Use a public HTML or PDF URL when full paper content is
34needed, and inspect for missing methods, results, equations, figures, tables,
35and references. Extraction may be partial, unavailable, or blocked by access
36controls. Do not present an abstract or truncated extraction as the full paper.

Academic content handling

When extracting from academic sources (arXiv, PubMed, journal sites, conference proceedings), use --text to request the page text:

uv run "$SKILL_PATH/scripts/exa_extract.py" "$URL" \
  --text \
  -o "$FILENAME.json"

For arXiv, /abs/ is an abstract/metadata page; it is not proof that the full paper was extracted. Use a public HTML or PDF URL when full paper content is needed, and inspect for missing methods, results, equations, figures, tables, and references. Extraction may be partial, unavailable, or blocked by access controls. Do not present an abstract or truncated extraction as the full paper.

Raw lines 22 to 37
Runs code scripts/exa_extract.py :27
38### Freshness and returned status
40Add `--max-age-hours 0` for a fresh fetch, `-1` for cache only, or an integer
411–720 to bound cache age. Omit it to let Exa use cached content and fetch when
42unavailable. This maps to SDK `max_age_hours` / JSON `maxAgeHours`; the older
43`livecrawl` control is deprecated.
45Output contains `urls`, `num_results`, `results`, and `statuses`. Each SDK status
46contains `id` (requested URL or document ID), `status` (`success` or `error`),
47and optional `source` (`cached` or `crawled`). Associate statuses by ID, not array
48position, and check that successful results contain usable text/highlights.
49SDK 2.23.0 discards API `statuses[].error` and `requestId`; these are unavailable
50in this wrapper. Do not guess whether an error was a paywall, timeout, or another
51cause. Publication date is not crawl/retrieval time.

Freshness and returned status

Add --max-age-hours 0 for a fresh fetch, -1 for cache only, or an integer 1–720 to bound cache age. Omit it to let Exa use cached content and fetch when unavailable. This maps to SDK max_age_hours / JSON maxAgeHours; the older livecrawl control is deprecated.

Output contains urls, num_results, results, and statuses. Each SDK status contains id (requested URL or document ID), status (success or error), and optional source (cached or crawled). Associate statuses by ID, not array position, and check that successful results contain usable text/highlights. SDK 2.23.0 discards API statuses[].error and requestId; these are unavailable in this wrapper. Do not guess whether an error was a paywall, timeout, or another cause. Publication date is not crawl/retrieval time.

Raw lines 38 to 52
53## Response format
55Return content as:
57**[Page Title](URL)**
59For academic papers, include structured metadata when available:
60- **Authors:** list of authors (from the `author` field)
61- **Published:** from `published_date`
63Then the extracted content, with these rules:
64- Follow the requested extraction scope; quote only content that can be reproduced lawfully, otherwise summarize and link to the saved extraction
65- When extracting a requested list, preserve its ordering and note any missing items
66- Strip only obvious noise: nav menus, footers, ads
67- Preserve the meaning and exact values of facts, names, numbers, and dates
68- For academic papers, retain relevant figure/table captions and references when present; report omissions
70**Partial-result handling** — when batching multiple URLs, one or more may fail (paywall, robots.txt, timeout). Report which URLs extracted successfully and which failed, rather than silently dropping failures.
72After the response, mention the output file path (`$FILENAME.json`) so the user knows it's available for follow-up questions.
74Verified against the [Contents API](https://exa.ai/docs/reference/get-contents) and [Python SDK source](https://github.com/exa-labs/exa-py/blob/master/exa_py/api.py) on 2026-09-30; authenticated commands are illustrative.

Response format

Return content as:

Page Title

For academic papers, include structured metadata when available:

  • Authors: list of authors (from the author field)
  • Published: from published_date

Then the extracted content, with these rules:

  • Follow the requested extraction scope; quote only content that can be reproduced lawfully, otherwise summarize and link to the saved extraction
  • When extracting a requested list, preserve its ordering and note any missing items
  • Strip only obvious noise: nav menus, footers, ads
  • Preserve the meaning and exact values of facts, names, numbers, and dates
  • For academic papers, retain relevant figure/table captions and references when present; report omissions

Partial-result handling — when batching multiple URLs, one or more may fail (paywall, robots.txt, timeout). Report which URLs extracted successfully and which failed, rather than silently dropping failures.

After the response, mention the output file path ($FILENAME.json) so the user knows it's available for follow-up questions.

Verified against the Contents API and Python SDK source on 2026-09-30; authenticated commands are illustrative.

Raw lines 53 to 74