How to power coding agents with Linkup
Enable AI coding assistants to search documentation, find code examples, troubleshoot errors, and research libraries in real-time.
In This Guide
Documentation Lookup
Find and extract official API documentation
Error Troubleshooting
Search for solutions to errors and bugs
Code Example Search
Find implementation patterns and examples
Library & Package Research
Evaluate and compare packages
API Integration Research
Research how to integrate external APIs
Security & Vulnerability Lookup
Check for CVEs and security advisories
Overview
Coding agents and AI assistants are only as good as the context they have access to. When an agent encounters an unfamiliar API, a cryptic error message, or needs to implement an integration it hasn't seen before, it needs real-time access to documentation, examples, and solutions. Linkup provides that bridge—giving coding agents the ability to search docs, find code examples, troubleshoot errors, and research libraries on demand.
Why Linkup for coding agents?
deep searchFind documentation, then scrape full pages for complete context
structured outputReturns code examples and API specs in formats agents can consume
agentic retrievalNavigates official docs, GitHub, Stack Overflow, and forums automatically
fromDate filteringSurface recent solutions and avoid deprecated approaches
Configuration
Recommended settings for coding agents
| Parameter | Value | Why |
|---|---|---|
depth | standard or deep | Simple doc lookups work with standard; complex troubleshooting benefits from deep |
outputType | structured | Agents need structured data they can parse and act on |
includeDomains | trusted sources | Avoid low-quality or outdated code examples |
fromDate | recent solutions | Especially important for fast-moving frameworks |
Use Cases
Practical examples with prompts and schemas
Documentation Lookup
Find and extract official documentation for APIs, libraries, and frameworks
You are a documentation research assistant helping a coding agent.
Query: {agent_query}
Technology: {technology}
Version (if known): {version}
Execute the following steps:
1. Search for the official documentation page for {technology} related to: {agent_query}
2. Once found, scrape the documentation page to extract:
- The relevant section of documentation
- Code examples provided
- Function/method signatures
- Parameter descriptions
- Return value documentation
- Any warnings or important notes
3. If the documentation references related pages (e.g., "see also" links), note them for potential follow-up.
Return documentation content structured for an AI coding agent to consume.
Prioritize official documentation over third-party tutorials.{
"includeDomains": [
"docs.python.org",
"developer.mozilla.org",
"docs.microsoft.com",
"cloud.google.com",
"docs.aws.amazon.com",
"reactjs.org",
"vuejs.org",
"docs.djangoproject.com",
"fastapi.tiangolo.com",
"nextjs.org",
"kubernetes.io",
"docs.docker.com"
]
}Error Troubleshooting
Search for solutions to error messages, exceptions, and bugs
You are a debugging assistant helping a coding agent resolve an error.
Error message: {error_message}
Technology/framework: {technology}
Context: {context_description}
Stack trace (if available): {stack_trace}
Execute the following steps:
1. Search for this exact error message to find known solutions.
2. Search Stack Overflow for questions matching this error and {technology}.
3. Search GitHub Issues in relevant repositories for this error.
4. For promising solutions found, extract:
- The root cause explanation
- The recommended fix
- Any code changes required
- Conditions where this solution applies
5. If multiple solutions exist, rank by:
- Recency (prefer solutions from the last 2 years)
- Vote count or acceptance status
- Relevance to the specific context
Return the most likely solutions with implementation details.{
"includeDomains": [
"stackoverflow.com",
"github.com",
"dev.to",
"hashnode.com",
"reddit.com/r/programming",
"reddit.com/r/webdev",
"reddit.com/r/node",
"reddit.com/r/python"
]
}Code Example Search
Find implementation examples for specific patterns, integrations, or features
You are a code research assistant finding implementation examples.
What to implement: {implementation_goal}
Language: {language}
Framework (if applicable): {framework}
Constraints: {constraints}
Execute the following steps:
1. Search for code examples and tutorials showing how to {implementation_goal} in {language}.
2. Search GitHub for repositories with example implementations. Look for:
- Official examples from framework maintainers
- Well-starred repositories with similar implementations
- Recent implementations (prefer last 2 years)
3. For each relevant example found, extract:
- The complete code snippet
- Required imports/dependencies
- Setup or configuration needed
- Any gotchas or edge cases mentioned
4. If the implementation requires multiple files or steps, capture the full sequence.
Prioritize:
1. Official documentation examples
2. Well-maintained open source projects
3. Highly-voted Stack Overflow answers
4. Recent blog posts from reputable sourcesLibrary & Package Research
Help agents choose the right library or understand package capabilities
You are a package research assistant helping evaluate libraries.
Need: {what_agent_needs}
Language/ecosystem: {language}
Current stack: {current_stack}
Requirements: {requirements}
Execute the following steps:
1. Search for libraries/packages that provide {what_agent_needs} in {language}.
2. For each candidate library, search for and extract:
- Package name and installation command
- GitHub stars and recent activity
- Latest version and release date
- Key features relevant to {requirements}
- Known limitations or issues
- Compatibility with {current_stack}
3. Search for comparison articles: "{library_a} vs {library_b}" for top candidates.
4. Search for recent discussions about each library (Reddit, Hacker News, dev forums) to gauge community sentiment.
Return a comparison with recommendation.API Integration Research
Research how to integrate with external APIs the agent hasn't seen before. deep recommended
You are an API integration research assistant.
API to integrate: {api_name}
Integration goal: {what_to_accomplish}
Language: {language}
Execute the following steps:
1. Find the official API documentation for {api_name}.
2. Scrape the documentation to extract:
- Authentication method (API key, OAuth, etc.)
- Base URL and endpoints relevant to {what_to_accomplish}
- Request/response formats
- Rate limits and quotas
- Required headers
3. Search for {language} SDK or client library for {api_name}. If one exists:
- Find installation instructions
- Find code examples for {what_to_accomplish}
4. Search for tutorials or blog posts showing {api_name} integration in {language}.
5. Search for common issues or gotchas when integrating with {api_name}.
Return complete integration guide with scraped examples.Security & Vulnerability Lookup
Check for known vulnerabilities and security advisories
You are a security research assistant checking for vulnerabilities.
Package: {package_name}
Version: {version}
Ecosystem: {ecosystem}
Execute the following steps:
1. Search for known CVEs affecting {package_name} version {version}.
2. Search the GitHub Advisory Database for {package_name}.
3. Search for security-related issues in the {package_name} repository.
4. Check if there are any security advisories from the package maintainers.
5. For any vulnerabilities found, extract:
- CVE ID and severity score
- Affected version range
- Fixed version (if available)
- Exploit description
- Recommended mitigation
Return all known security issues with remediation guidance.{
"includeDomains": [
"nvd.nist.gov",
"github.com/advisories",
"cve.mitre.org",
"snyk.io",
"security.snyk.io",
"huntr.dev"
]
}Best Practices
Tips for getting the best results
Do's
- 1Always include version information — solutions vary dramatically between versions
- 2Use includeDomains for trusted sources — avoid low-quality code that introduces bugs or security issues
- 3Set fromDate for fast-moving ecosystems — React, Next.js, Python packages change rapidly
- 4Request structured code output — agents need parseable code, not prose descriptions
- 5Include context in error searches — "Error X in Django" yields better results than just "Error X"
- 6Use deep for integration research — finding docs, scraping them, then finding examples requires multiple steps
Don'ts
- 1Don't trust arbitrary code sources — restrict to official docs, well-maintained repos, and vetted communities
- 2Don't skip version checks — code from 2019 may not work with 2024 frameworks
- 3Don't search for full error stack traces — extract the key error message; stack traces are too specific
- 4Don't ignore security signals — when researching packages, always check for known vulnerabilities
Domain Allowlists (Example)
Trusted source domains by category
{
"includeDomains": [
"docs.python.org",
"developer.mozilla.org",
"docs.microsoft.com",
"cloud.google.com/docs",
"docs.aws.amazon.com",
"kubernetes.io/docs",
"docs.docker.com",
"reactjs.org",
"vuejs.org",
"angular.io",
"nextjs.org",
"nodejs.org",
"docs.npmjs.com",
"pypi.org",
"pkg.go.dev",
"docs.rs",
"rubydoc.info"
]
}{
"includeDomains": [
"stackoverflow.com",
"stackexchange.com",
"reddit.com/r/programming",
"reddit.com/r/webdev",
"reddit.com/r/node",
"reddit.com/r/python",
"reddit.com/r/rust",
"reddit.com/r/golang",
"dev.to",
"hashnode.com"
]
}{
"includeDomains": [
"github.com",
"raw.githubusercontent.com",
"gist.github.com"
]
}{
"includeDomains": [
"nvd.nist.gov",
"cve.mitre.org",
"github.com/advisories",
"snyk.io",
"security.snyk.io"
]
}Integration Patterns
How to integrate Linkup into your coding agent
Agent Tool Integration
Define Linkup as tools the agent can call
- •search_documentation — Input: query, technology, version. Use when: agent needs to look up unfamiliar APIs
- •troubleshoot_error — Input: error_message, technology, context. Use when: agent encounters an error it can't resolve
- •find_code_example — Input: implementation_goal, language, framework. Use when: agent needs to implement something new
- •research_package — Input: need, language, requirements. Use when: agent needs to choose a library
- •check_security — Input: package, version, ecosystem. Use when: agent adds a new dependency
Caching Strategy
Optimize performance for high-frequency lookups
- •Cache documentation lookups by (technology, version, query_hash) — TTL: 7 days for stable APIs, 1 day for fast-moving frameworks
- •Cache package metadata by (package, ecosystem) — TTL: 1 day (versions change frequently)
- •Don't cache error troubleshooting — solutions evolve; always search fresh
- •Cache security lookups by (package, version) — TTL: 1 hour (new CVEs can be critical)
Context Window Management
When feeding Linkup results to an agent
- •Extract only relevant code snippets (not full pages)
- •Include source URLs for attribution
- •Prioritize: code > signatures > descriptions
- •Truncate long examples to key patterns
- •Include version info to avoid hallucination
Sample Code
Python integration example
import requests
import json
from typing import Optional
class LinkupCodingAssistant:
"""Linkup integration for coding agents"""
def __init__(self, api_key: str):
self.api_key = api_key
self.base_url = "https://api.linkup.so/v1/search"
def _call_linkup(
self,
prompt: str,
schema: dict,
depth: str = "standard",
include_domains: list = None,
from_date: str = None
) -> dict:
params = {
"q": prompt,
"depth": depth,
"outputType": "structured",
"structuredSchema": json.dumps(schema)
}
if include_domains:
params["includeDomains"] = include_domains
if from_date:
params["fromDate"] = from_date
response = requests.post(
self.base_url,
headers={"Authorization": f"Bearer {self.api_key}"},
json=params
)
return response.json()
def search_documentation(
self,
query: str,
technology: str,
version: Optional[str] = None
) -> dict:
"""Look up official documentation"""
version_str = f"version {version}" if version else ""
prompt = f"""
Find official documentation for {technology} {version_str} related to: {query}
Scrape the documentation page to extract:
- Relevant section content
- Code examples
- Function signatures with parameters
- Return types
- Warnings or important notes
Prioritize official documentation over tutorials.
"""
schema = {
"type": "object",
"properties": {
"source_url": {"type": "string"},
"description": {"type": "string"},
"code_examples": {
"type": "array",
"items": {
"type": "object",
"properties": {
"language": {"type": "string"},
"code": {"type": "string"}
}
}
},
"api_signatures": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {"type": "string"},
"signature": {"type": "string"},
"parameters": {"type": "array"},
"return_type": {"type": "string"}
}
}
},
"warnings": {"type": "array", "items": {"type": "string"}}
}
}
return self._call_linkup(
prompt,
schema,
depth="deep"
)
def troubleshoot_error(
self,
error_message: str,
technology: str,
context: Optional[str] = None
) -> dict:
"""Find solutions for an error"""
context_str = f"Context: {context}" if context else ""
prompt = f"""
Find solutions for this error in {technology}:
Error: {error_message}
{context_str}
Search Stack Overflow and GitHub Issues.
For each solution, extract:
- Root cause
- Fix with code changes
- When this solution applies
Rank by recency and community validation.
"""
schema = {
"type": "object",
"properties": {
"solutions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"source_url": {"type": "string"},
"root_cause": {"type": "string"},
"solution": {"type": "string"},
"code_fix": {"type": "string"},
"confidence": {"type": "string"},
"upvotes": {"type": "integer"}
}
}
},
"recommended_solution": {"type": "integer"}
}
}
return self._call_linkup(
prompt,
schema,
depth="standard",
include_domains=["stackoverflow.com", "github.com"]
)
def find_code_example(
self,
goal: str,
language: str,
framework: Optional[str] = None
) -> dict:
"""Find implementation examples"""
framework_str = f"using {framework}" if framework else ""
prompt = f"""
Find code examples for: {goal}
Language: {language} {framework_str}
Search for:
1. Official documentation examples
2. Well-maintained GitHub repositories
3. Highly-voted Stack Overflow answers
Extract complete code with dependencies and setup steps.
"""
schema = {
"type": "object",
"properties": {
"examples": {
"type": "array",
"items": {
"type": "object",
"properties": {
"source_url": {"type": "string"},
"source_quality": {"type": "string"},
"dependencies": {"type": "array"},
"code": {"type": "string"},
"explanation": {"type": "string"}
}
}
},
"recommended_approach": {"type": "string"}
}
}
return self._call_linkup(prompt, schema, depth="deep")
def check_security(
self,
package: str,
version: str,
ecosystem: str
) -> dict:
"""Check for known vulnerabilities"""
prompt = f"""
Search for security vulnerabilities in {package} version {version} ({ecosystem}).
Check:
- CVE databases
- GitHub Advisory Database
- Package security advisories
For each vulnerability, extract CVE ID, severity, affected versions, and fix.
"""
schema = {
"type": "object",
"properties": {
"vulnerabilities": {
"type": "array",
"items": {
"type": "object",
"properties": {
"cve_id": {"type": "string"},
"severity": {"type": "string"},
"cvss_score": {"type": "number"},
"affected_versions": {"type": "string"},
"fixed_version": {"type": "string"},
"description": {"type": "string"},
"mitigation": {"type": "string"}
}
}
},
"security_status": {"type": "string"},
"recommended_action": {"type": "string"}
}
}
return self._call_linkup(
prompt,
schema,
depth="standard",
include_domains=["nvd.nist.gov", "github.com/advisories", "snyk.io"]
)
# Example usage
if __name__ == "__main__":
assistant = LinkupCodingAssistant(api_key="your-api-key")
# Documentation lookup
docs = assistant.search_documentation(
query="async context managers",
technology="Python",
version="3.11"
)
# Error troubleshooting
fix = assistant.troubleshoot_error(
error_message="TypeError: Cannot read property 'map' of undefined",
technology="React",
context="Fetching data in useEffect"
)
# Security check
security = assistant.check_security(
package="lodash",
version="4.17.15",
ecosystem="npm"
)