Back to Use Cases
Linkup

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.

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 search

Find documentation, then scrape full pages for complete context

structured output

Returns code examples and API specs in formats agents can consume

agentic retrieval

Navigates official docs, GitHub, Stack Overflow, and forums automatically

fromDate filtering

Surface recent solutions and avoid deprecated approaches

Configuration

Recommended settings for coding agents

ParameterValueWhy
depthstandard or deepSimple doc lookups work with standard; complex troubleshooting benefits from deep
outputTypestructuredAgents need structured data they can parse and act on
includeDomainstrusted sourcesAvoid low-quality or outdated code examples
fromDaterecent solutionsEspecially important for fast-moving frameworks

Use Cases

Practical examples with prompts and schemas

1

Documentation Lookup

Find and extract official documentation for APIs, libraries, and frameworks

Prompt- documentation-lookup
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.
trusted-documentation-domains.json (Example)
{
  "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"
  ]
}
json
2

Error Troubleshooting

Search for solutions to error messages, exceptions, and bugs

Prompt- error-troubleshooting
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.
troubleshooting-domains.json (Example)
{
  "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"
  ]
}
json
4

Library & Package Research

Help agents choose the right library or understand package capabilities

Prompt- library-research
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.
5

API Integration Research

Research how to integrate with external APIs the agent hasn't seen before. deep recommended

Prompt- api-integration
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.
6

Security & Vulnerability Lookup

Check for known vulnerabilities and security advisories

Prompt- security-lookup
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.
security-research-domains.json (Example)
{
  "includeDomains": [
    "nvd.nist.gov",
    "github.com/advisories",
    "cve.mitre.org",
    "snyk.io",
    "security.snyk.io",
    "huntr.dev"
  ]
}
json

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
x

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
Pro Tip
When feeding Linkup results to an agent: extract only relevant code snippets (not full pages), include source URLs for attribution, prioritize code over descriptions, truncate long examples to key patterns, and include version info to avoid hallucination.

Domain Allowlists (Example)

Trusted source domains by category

Official Documentation
{
  "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"
  ]
}
json
Community Q&A
{
  "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"
  ]
}
json
GitHub Resources
{
  "includeDomains": [
    "github.com",
    "raw.githubusercontent.com",
    "gist.github.com"
  ]
}
json
Security Research
{
  "includeDomains": [
    "nvd.nist.gov",
    "cve.mitre.org",
    "github.com/advisories",
    "snyk.io",
    "security.snyk.io"
  ]
}
json

Integration Patterns

How to integrate Linkup into your coding agent

Agent Tool Integration

Define Linkup as tools the agent can call

  1. search_documentation — Input: query, technology, version. Use when: agent needs to look up unfamiliar APIs
  2. troubleshoot_error — Input: error_message, technology, context. Use when: agent encounters an error it can't resolve
  3. find_code_example — Input: implementation_goal, language, framework. Use when: agent needs to implement something new
  4. research_package — Input: need, language, requirements. Use when: agent needs to choose a library
  5. check_security — Input: package, version, ecosystem. Use when: agent adds a new dependency

Caching Strategy

Optimize performance for high-frequency lookups

  1. Cache documentation lookups by (technology, version, query_hash) — TTL: 7 days for stable APIs, 1 day for fast-moving frameworks
  2. Cache package metadata by (package, ecosystem) — TTL: 1 day (versions change frequently)
  3. Don't cache error troubleshooting — solutions evolve; always search fresh
  4. Cache security lookups by (package, version) — TTL: 1 hour (new CVEs can be critical)

Context Window Management

When feeding Linkup results to an agent

  1. Extract only relevant code snippets (not full pages)
  2. Include source URLs for attribution
  3. Prioritize: code > signatures > descriptions
  4. Truncate long examples to key patterns
  5. Include version info to avoid hallucination

Sample Code

Python integration example

linkup_coding_assistant.py
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"
    )
python