What the skill is about
Fetch references from Semantic Scholar Graph API, OpenAlex, or Google Scholar (via scholarly) and keep only real BibTeX entries.
When to use the skill
- Final report/paper generation.
- Related-work section needs grounded citations.
What to do
- Build focused search queries from task goal, method names, and top experiment ideas.
- Preferred path (Semantic Scholar Graph API):
python scripts/s2_fetch.py \
--query "query one" \
--query "query two" \
--min-refs 8 \
--max-refs 15 \
--out-bib references.bib \
--out-json references_provenance.json
- Fallback path (OpenAlex):
python scripts/openalex_fetch.py \
--query "query one" \
--query "query two" \
--min-refs 8 \
--max-refs 15 \
--search-limit 10 \
--out-bib references.bib \
--out-json references_provenance.json
Optional:
--mailto you@example.comto enter the OpenAlex polite pool- Env fallback:
OPENALEX_EMAIL
- Alternate path (Google Scholar API wrapper with
scholarly):
python -m pip install scholarly
python scripts/scholarly_fetch.py \
--query "query one" \
--query "query two" \
--min-refs 8 \
--max-refs 15 \
--search-limit 25 \
--sort-by relevance \
--proxy-mode auto \
--delay-seconds 0.5 \
--out-bib references.bib \
--out-json references_provenance.json
Proxy options:
--proxy-mode auto|none|free|single--proxy-http <url>/--proxy-https <url>forsingle- Env fallbacks:
SCHOLARLY_PROXY_MODE,SCHOLARLY_PROXY_HTTP,SCHOLARLY_PROXY_HTTPS - Global
HTTP_PROXY/HTTPS_PROXYare intentionally ignored to avoid accidental ambient proxying
- Require
S2_API_KEYwhen available fors2_fetch.py(script reads env automatically). - Keep only references with valid BibTeX and citation key.
- Dedupe by citation key and paper id.
- Fail hard if references found
< min-refs. - Use
s2_fetch.pyfirst for stability,openalex_fetch.pyas the next fallback, andscholarly_fetch.pylast if the other sources fail.
Outputs
references.bibreferences_provenance.json
Notes
- Use
templates/provenance.schema.jsonfor expected shape.