Claude Skill

arxiv-lookup

Look up arXiv paper metadata via the arXiv API. Use when you need to get a journal DOI from an arXiv ID (for OpenAlex integration), or find an arXiv ID from a title/keyword search (for arxiv-doc-builder). Requires the `arxiv` Python package.

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download ultimatile-arxiv-skills-skills_arxiv-lookup-65fcb58.zip · 2 KB
Part of ultimatile/arxiv-skills — 2 skills

Install

skills CLI npx skills add https://github.com/ultimatile/arxiv-skills/tree/main/skills/arxiv-lookup
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install ultimatile-arxiv-skills@llmmart
Git git clone https://github.com/ultimatile/arxiv-skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole ultimatile/arxiv-skills collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

arXiv Lookup

Lightweight scripts for querying the arXiv API directly via arxiv.py.

Scripts

In the commands below, SKILL_DIR is a placeholder, not a shell variable: replace it with the absolute path of the directory this SKILL.md is in. Keep the double quotes around the path, so a path containing spaces stays one argument. --no-project keeps uv from building the environment from a project in your working directory. The commands then run from any working directory.

Get Journal DOI from arXiv ID

uv run --no-project --with arxiv "SKILL_DIR/scripts/get_doi.py" <arxiv_id>
  • Returns the journal DOI if available (exit 0), or exits with error (exit 1) if not found
  • This is the journal-assigned DOI, not the arXiv-assigned DOI (10.48550/arXiv.{id})
  • arXiv-assigned DOI can be constructed mechanically: 10.48550/arXiv.<id> — no API call needed

Search arXiv and Get IDs

uv run --no-project --with arxiv "SKILL_DIR/scripts/search_id.py" <query> [max_results]
  • Searches the arXiv API directly (no local database)
  • Returns tab-separated arxiv_id\ttitle lines
  • Default: 5 results, sorted by relevance
  • Query supports arXiv API field prefixes: ti: (title), au: (author), abs: (abstract), cat: (category)
  • Use quotes for exact phrases: ti:"Attention Is All You Need"
  • Combine with AND/OR/ANDNOT: ti:transformer AND cat:cs.CL

Integration Notes

  • OpenAlex: Use get_doi.py to obtain journal DOIs for OpenAlex queries
  • arxiv-doc-builder: Use search_id.py to find arXiv IDs, then pass to arxiv-doc-builder
Files (arxiv-skills)
  • scripts
    • get_doi.py 838 B
      #!/usr/bin/env python3
      """Get journal DOI for an arXiv paper by its ID."""
      
      import sys
      
      import arxiv
      
      
      def get_doi(arxiv_id: str) -> str | None:
          """Return the journal DOI for the given arXiv ID, or None if not available."""
          client = arxiv.Client()
          search = arxiv.Search(id_list=[arxiv_id])
          results = list(client.results(search))
          if not results:
              print(f"Paper not found: {arxiv_id}", file=sys.stderr)
              sys.exit(1)
          return results[0].doi
      
      
      def main() -> None:
          if len(sys.argv) != 2:
              print(f"Usage: {sys.argv[0]} <arxiv_id>", file=sys.stderr)
              sys.exit(1)
      
          arxiv_id = sys.argv[1]
          doi = get_doi(arxiv_id)
          if doi:
              print(doi)
          else:
              print(f"No journal DOI found for {arxiv_id}", file=sys.stderr)
              sys.exit(1)
      
      
      if __name__ == "__main__":
          main()
      
    • search_id.py 1.1 KB
      #!/usr/bin/env python3
      """Search arXiv and return matching paper IDs with titles."""
      
      import sys
      
      import arxiv
      
      
      def search_arxiv(query: str, max_results: int = 5) -> list[arxiv.Result]:
          """Search arXiv API directly and return results."""
          client = arxiv.Client()
          search = arxiv.Search(
              query=query,
              max_results=max_results,
              sort_by=arxiv.SortCriterion.Relevance,
          )
          return list(client.results(search))
      
      
      def main() -> None:
          if len(sys.argv) < 2:
              print(f"Usage: {sys.argv[0]} <query> [max_results]", file=sys.stderr)
              sys.exit(1)
      
          query = sys.argv[1]
          max_results = int(sys.argv[2]) if len(sys.argv) > 2 else 5
      
          results = search_arxiv(query, max_results)
          if not results:
              print(f"No results for: {query}", file=sys.stderr)
              sys.exit(1)
      
          for r in results:
              # entry_id is like http://arxiv.org/abs/1234.56789v1 — extract the ID
              arxiv_id = r.entry_id.split("/abs/")[-1]
              # Strip version suffix for cleaner output
              base_id = arxiv_id.rsplit("v", 1)[0]
              print(f"{base_id}\t{r.title}")
      
      
      if __name__ == "__main__":
          main()
      
  • SKILL.md 1.8 KB
    ---
    name: arxiv-lookup
    description: Look up arXiv paper metadata via the arXiv API. Use when you need to get a journal DOI from an arXiv ID (for OpenAlex integration), or find an arXiv ID from a title/keyword search (for arxiv-doc-builder). Requires the `arxiv` Python package.
    ---
    
    # arXiv Lookup
    
    Lightweight scripts for querying the arXiv API directly via `arxiv.py`.
    
    ## Scripts
    
    In the commands below, `SKILL_DIR` is a placeholder, not a shell variable: replace it with the absolute path of the directory this SKILL.md is in. Keep the double quotes around the path, so a path containing spaces stays one argument. `--no-project` keeps uv from building the environment from a project in your working directory. The commands then run from any working directory.
    
    ### Get Journal DOI from arXiv ID
    
    ```bash
    uv run --no-project --with arxiv "SKILL_DIR/scripts/get_doi.py" <arxiv_id>
    ```
    
    - Returns the journal DOI if available (exit 0), or exits with error (exit 1) if not found
    - This is the **journal-assigned DOI**, not the arXiv-assigned DOI (`10.48550/arXiv.{id}`)
    - arXiv-assigned DOI can be constructed mechanically: `10.48550/arXiv.<id>` — no API call needed
    
    ### Search arXiv and Get IDs
    
    ```bash
    uv run --no-project --with arxiv "SKILL_DIR/scripts/search_id.py" <query> [max_results]
    ```
    
    - Searches the arXiv API directly (no local database)
    - Returns tab-separated `arxiv_id\ttitle` lines
    - Default: 5 results, sorted by relevance
    - Query supports arXiv API field prefixes: `ti:` (title), `au:` (author), `abs:` (abstract), `cat:` (category)
    - Use quotes for exact phrases: `ti:"Attention Is All You Need"`
    - Combine with AND/OR/ANDNOT: `ti:transformer AND cat:cs.CL`
    
    ## Integration Notes
    
    - **OpenAlex**: Use `get_doi.py` to obtain journal DOIs for OpenAlex queries
    - **arxiv-doc-builder**: Use `search_id.py` to find arXiv IDs, then pass to arxiv-doc-builder
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related