← Về thư mục
📄 / / root / .hermes / skills / research / api-credential-acquisition / SKILL.md

name: api-credential-acquisition description: "Guides the process of acquiring API keys or access tokens for various external services, including web navigation, account creation, storage, and proxy setup for blocked/non-API services like Google Scholar." version: 1.2.0 author: Hermes Agent license: MIT platforms: [linux, macos, windows] metadata: hermes: tags: [API, Credentials, Authentication, Setup, Research, Data Access, Proxy] related_skills: [paper-search-mcp] linked_files: references: [google-scholar-proxy-rotation.md]


API Credential Acquisition Workflow

This skill covers systematic acquisition of API keys/access tokens for research services (academic databases, content platforms), including proxy setup for services that lack official APIs (Google Scholar).

Workflow Steps

  1. Identify Required Credentials:

    • Determine which services require API keys/tokens.
    • Some services (Semantic Scholar, DOAJ) work without keys at reduced rate limits — document and move on.
  2. Locate API Documentation/Registration Page:

    • Use web_search or browser_navigate to find the official API documentation or a dedicated "Request API Key" / "Developers" section.
    • Look for terms like "API", "Developers", "Access Token", "Personal Access Token", "Register", "Sign Up".
  3. Review Authentication Method:

    • Understand how the API expects to be authenticated (e.g., API key in header, OAuth, token in URL).
    • Check rate limits and usage policies.
  4. Account Creation/Login:

    • If an account is required, guide the user to create one or provide their existing login credentials.
    • Use browser_navigate, browser_type, and browser_click to interact with registration/login forms.
    • Pitfall: Some services require logged-in session to show API key request forms. If clicking "Request an API key" doesn't produce a form, try Sign In first then retry.
    • Pitfall: Many platforms require human interaction (CAPTCHA, email verification). Hand off to the user with clear instructions.
  5. Generate/Request API Key/Token:

    • Follow the service's specific instructions to generate the key/token.
    • This often involves navigating to "Settings", "Applications", or "API Access" within the user's profile.
    • Copy the generated key/token immediately as it may not be shown again.
  6. Secure Storage:

    • Store credentials in the tool-specific .env file (e.g., ~/.config/paper-search-mcp/.env).
    • Use terminal with Python string manipulation to target a single key: parse the file, replace the matching line, write back.
    • Example snippet (preferred method — avoids leaking secrets via echo/cat): python import os path = os.path.expanduser("~/.config/paper-search-mcp/.env") with open(path) as f: lines = f.readlines() new_lines = [] for line in lines: if line.startswith("PAPER_SEARCH_MCP_ZENODO_ACCESS_TOKEN="): new_lines.append(f"PAPER_SEARCH_MCP_ZENODO_ACCESS_TOKEN={token}\n") else: new_lines.append(line) with open(path, "w") as f: f.writelines(new_lines)
  7. Proxy Setup for Google Scholar (No-API Services):

    • Google Scholar has NO official API. The paper-search-mcp tool uses web scraping.
    • You MUST provide a proxy URL in PAPER_SEARCH_MCP_GOOGLE_SCHOLAR_PROXY_URL or Google Scholar will ban the VPS IP after a few requests (429/CAPTCHA).
    • Self-service approach (preferred — do not ask user): Use free HTTP proxy lists from GitHub, test against scholar.google.com, auto-update .env. See references/google-scholar-proxy-rotation.md for the script and cron setup.
    • For production use, recommend a paid rotating proxy service (ScraperAPI, ZenRows).
  8. Tool Configuration/Integration:

    • After adding credentials, the MCP server loads them from the .env file on next tool invocation.
    • Remind the user to run /reset to refresh the agent session and pick up new tools.

When to Skip / Abandon a Service

Pitfalls and Troubleshooting


Service-Specific Reference (learned from real sessions)

Academic Services

Setup Steps for Paper-Search-MCP

If using the paper-search-mcp server, ensure the following environment variables are set in the configuration or shell: - CORE_API_KEY - DOAJ_API_KEY - SEMANTIC_SCHOLAR_API_KEY - ZENODO_ACCESS_TOKEN

Semantic Scholar

Zenodo

CORE

DOAJ

Google Scholar

Unpaywall