# Install the LangSearch skill

LangSearch is a free Web Search API for AI agents. The World Engine for AGI.

Use this guide when the user asks to install the LangSearch skill in their agent. The skill adds instructions for searching the web, retrieving source text, and keeping citation URLs. It does not install an MCP server or run a background service.

## 1. Choose the installation location

Use the current agent's supported skill installer or skill directory. Follow its existing project or user-level convention and the scope requested by the user. If the agent has no filesystem access, provide the file and installation location to the user instead of claiming it was installed.

Create a `langsearch` directory inside that skill directory. Check for an existing installation first; preserve local customizations when updating it.

## 2. Download the skill

Save the following Markdown file as `langsearch/SKILL.md`:

**https://langsearch.com/install/langsearch/SKILL.md**

For a local agent with a shell, set `LANGSEARCH_SKILLS_DIR` to its supported skill directory, then run:

```sh
: "${LANGSEARCH_SKILLS_DIR:?Set this to your agent's supported skill directory}"
mkdir -p "$LANGSEARCH_SKILLS_DIR/langsearch"
curl --fail --silent --show-error --location \
  https://langsearch.com/install/langsearch/SKILL.md \
  --output "$LANGSEARCH_SKILLS_DIR/langsearch/SKILL.md"
```

The command above writes the skill file. Review any existing file before running it. Read the downloaded file and confirm it is Markdown with `name: langsearch` in its YAML frontmatter, rather than an HTML error page. Reload the agent's skills or start a new session if its skill discovery requires it.

If the agent does not support installable skills, use the file as task context and explain that it has not been installed for future sessions.

## 3. Configure an API key

Create an API key in **[LangSearch Dashboard → API keys](https://langsearch.com/api-keys)**. Provide it to the agent's trusted execution environment as `LANGSEARCH_API_KEY`, using its environment or secret settings. Keep the actual key out of `SKILL.md`, repositories, browser bundles, and logs.

If no key is available, finish installing the skill and report that API access still needs configuration. Do not invent a key or change unrelated agent settings.

## 4. Verify the installation

Confirm that the skill file is in the agent's recognized directory. When a key is configured and a search is within the user's requested scope, run one small request using the example in `SKILL.md` with `count: 1`.

- HTTP `200` with a `data.webPages.value` array confirms API access; an empty array is valid.
- `401` or `403` means credentials or account access need attention.
- `429` may indicate rate limiting or exhausted daily allowance. Check the Dashboard; the daily allowance resets at **00:00 UTC**.
- For server failures or timeouts, use bounded retries. Do not repeatedly retry invalid credentials.

Report the installed file location and whether API access was verified or still needs a key. Do not report success based only on downloading this guide.

## References

- [Skill file](https://langsearch.com/install/langsearch/SKILL.md)
- [Web Search integration contract](https://docs.langsearch.com/reference/search-api-guide-for-coding-agents)
- [API reference](https://docs.langsearch.com/api/web-search-api)
- [OpenAPI specification](https://docs.langsearch.com/api/openapi.json)
- [MCP setup](https://docs.langsearch.com/integrations/mcp) — an alternative hosted tool connection at `https://mcp.langsearch.com/mcp`.
