GitSeekGitSeek

API Documentation

Overview

GitSeek Code-to-Prompt API helps you extract complete, context-rich code from any repository for use in AI tools. Perfect for getting precise code snippets to analyze with Claude, implement similar features with Cursor, or understand complex architectures.

Authentication

All API requests require authentication using an API key. You can get your API key from the dashboard after signing up.

Include your API key in the request headers:

X-Api-Key: your_api_key_here

Extract Code from Repository

POST /api/code-to-prompt

Request Parameters

{
  url: string;              // Repository URL to analyze (required)
  query?: string;          // Natural language description of the code you want to extract. If not provided, returns the entire repository content.
}

Example Request

Here's how to extract authentication-related code from a repository:

curl -X POST https://app.gitseek.ai/api/code-to-prompt \
  -H 'X-Api-Key: your_api_key_here' \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://github.com/username/repo",
    "query": "authentication implementation and related code"
  }'

Response

{
  summary: {               // Analysis summary including repository name, number of files analyzed, and token count
    repository_name: string;
    files_analyzed: number;
    estimated_tokens: string;
  };
  tree: string;           // Structured view of the repository's file hierarchy
  content: string;        // Extracted code content with full context
}

错误码(Error Codes)

  • 401: Unauthorized Invalid or missing API key

  • 403: Forbidden Insufficient credits

  • 400: Bad Request Invalid request parameters