get_twitterapi_auth
Set up authentication for TwitterAPI.io by learning API key usage, required headers, and viewing code examples in cURL, Python, and JavaScript.
Instructions
Get TwitterAPI.io authentication guide: API key usage, headers, code examples.
USE THIS WHEN: You need to set up authentication or see request examples. RETURNS: API key header format, base URL, cURL/Python/JavaScript examples.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:1439-1483 (handler)Handler implementation for the 'get_twitterapi_auth' tool. Loads authentication data from the docs JSON and returns a formatted Markdown response with API key usage instructions, base URL, and code examples in cURL, Python, and JavaScript.case "get_twitterapi_auth": { const auth = data.authentication || {}; return formatToolSuccess(`# TwitterAPI.io Authentication ## API Key Usage All requests require the \`${auth.header || "x-api-key"}\` header. ## Base URL \`${auth.base_url || "https://api.twitterapi.io"}\` ## Getting Your API Key 1. Go to ${auth.dashboard_url || "https://twitterapi.io/dashboard"} 2. Sign up / Log in 3. Copy your API key from the dashboard ## Request Examples ### cURL \`\`\`bash curl -X GET "${auth.base_url || "https://api.twitterapi.io"}/twitter/user/info?userName=elonmusk" \\ -H "${auth.header || "x-api-key"}: YOUR_API_KEY" \`\`\` ### Python \`\`\`python import requests response = requests.get( "${auth.base_url || "https://api.twitterapi.io"}/twitter/user/info", params={"userName": "elonmusk"}, headers={"${auth.header || "x-api-key"}": "YOUR_API_KEY"} ) print(response.json()) \`\`\` ### JavaScript \`\`\`javascript const response = await fetch( "${auth.base_url || "https://api.twitterapi.io"}/twitter/user/info?userName=elonmusk", { headers: { "${auth.header || "x-api-key"}": "YOUR_API_KEY" } } ); const data = await response.json(); \`\`\``); }
- index.js:1091-1118 (schema)Tool schema definition including inputSchema (no parameters required) and outputSchema specifying markdown text content for the authentication guide.name: "get_twitterapi_auth", description: `Get TwitterAPI.io authentication guide: API key usage, headers, code examples. USE THIS WHEN: You need to set up authentication or see request examples. RETURNS: API key header format, base URL, cURL/Python/JavaScript examples.`, inputSchema: { type: "object", properties: {}, }, outputSchema: { type: "object", properties: { content: { type: "array", items: { type: "object", properties: { type: { type: "string", enum: ["text"] }, text: { type: "string", description: "Markdown with: API Key Usage header name, Base URL, Getting Your API Key steps, Request Examples (cURL, Python, JavaScript code blocks)" } } } } } } },
- index.js:894-1120 (registration)Registration of all tools including 'get_twitterapi_auth' in the ListToolsRequestSchema handler.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ { name: "search_twitterapi_docs", description: `Search TwitterAPI.io documentation: API endpoints, guides (pricing, rate limits, filter rules), and blog posts. USE THIS WHEN: You need to find information across the entire documentation. RETURNS: Ranked results with endpoint paths, descriptions, and relevance scores. Examples: - "advanced search" → finds tweet search endpoints - "rate limit" → finds QPS limits and pricing info - "webhook" → finds webhook setup endpoints - "getUserInfo" → finds user info endpoints (supports camelCase)`, inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query (1-500 chars). Use English keywords like: 'search', 'user', 'tweet', 'webhook', 'pricing', 'rate limit'. Supports camelCase and underscore formats.", minLength: 1, maxLength: 500 }, max_results: { type: "integer", description: "Number of results to return. Use higher values (15-20) for comprehensive research, lower values (3-5) for quick lookups.", minimum: 1, maximum: 20, default: 10 } }, required: ["query"], }, outputSchema: { type: "object", properties: { content: { type: "array", items: { type: "object", properties: { type: { type: "string", enum: ["text"] }, text: { type: "string", description: "Markdown formatted search results with sections: API Endpoints (name, method, path, description), Guides (name, title, url), Blog Posts (title, url)" } } } } } } }, { name: "get_twitterapi_endpoint", description: `Get complete documentation for a specific TwitterAPI.io endpoint. USE THIS WHEN: You know the exact endpoint name (e.g., from search results). RETURNS: Full details including path, parameters, cURL example, and code snippets. Common endpoints: - get_user_info, get_user_followers, get_user_following - tweet_advanced_search, get_tweet_by_id - add_webhook_rule, get_webhook_rules`, inputSchema: { type: "object", properties: { endpoint_name: { type: "string", description: "Exact endpoint name (use underscores). Examples: 'get_user_info', 'tweet_advanced_search', 'add_webhook_rule'", }, }, required: ["endpoint_name"], }, outputSchema: { type: "object", properties: { content: { type: "array", items: { type: "object", properties: { type: { type: "string", enum: ["text"] }, text: { type: "string", description: "Markdown with: Title, Endpoint Details (method, path, full URL, doc link), Description, Parameters list (name, required, description), cURL Example, Code Examples, Full Documentation" } } } } } } }, { name: "list_twitterapi_endpoints", description: `List all TwitterAPI.io API endpoints organized by category. USE THIS WHEN: You need to browse available endpoints or find endpoints by category. CATEGORIES: user, tweet, community, webhook, stream, action, dm, list, trend RETURNS: Endpoint names with HTTP method and path for each category.`, inputSchema: { type: "object", properties: { category: { type: "string", description: "Optional filter: user, tweet, community, webhook, stream, action, dm, list, trend", enum: ["user", "tweet", "community", "webhook", "stream", "action", "dm", "list", "trend"] }, }, }, outputSchema: { type: "object", properties: { content: { type: "array", items: { type: "object", properties: { type: { type: "string", enum: ["text"] }, text: { type: "string", description: "Markdown list organized by category (USER, TWEET, WEBHOOK, etc.) with endpoint format: name: METHOD /path" } } } } } } }, { name: "get_twitterapi_guide", description: `Get TwitterAPI.io guide pages for conceptual topics. USE THIS WHEN: You need information about pricing, rate limits, authentication, or filter rules. AVAILABLE GUIDES: pricing, qps_limits, tweet_filter_rules, changelog, introduction, authentication, readme RETURNS: Full guide content with headers, paragraphs, and code examples.`, inputSchema: { type: "object", properties: { guide_name: { type: "string", description: "Guide name: pricing, qps_limits, tweet_filter_rules, changelog, introduction, authentication, readme", enum: ["pricing", "qps_limits", "tweet_filter_rules", "changelog", "introduction", "authentication", "readme"] }, }, required: ["guide_name"], }, outputSchema: { type: "object", properties: { content: { type: "array", items: { type: "object", properties: { type: { type: "string", enum: ["text"] }, text: { type: "string", description: "Markdown with: Title, URL, Overview, Table of Contents, Content paragraphs, Key Points list, Code Examples, Full Content" } } } } } } }, { name: "get_twitterapi_pricing", description: `Get TwitterAPI.io pricing information: credit system, endpoint costs, QPS limits. USE THIS WHEN: You need to know API costs, credit calculations, or rate limits. RETURNS: Pricing tiers, credit costs per endpoint, QPS limits by balance level.`, inputSchema: { type: "object", properties: {}, }, outputSchema: { type: "object", properties: { content: { type: "array", items: { type: "object", properties: { type: { type: "string", enum: ["text"] }, text: { type: "string", description: "Markdown with: Credit System (USD to credits), Endpoint Costs table, Minimum Charge, QPS Limits by balance level, Important Notes, Cost Comparison" } } } } } } }, { name: "get_twitterapi_auth", description: `Get TwitterAPI.io authentication guide: API key usage, headers, code examples. USE THIS WHEN: You need to set up authentication or see request examples. RETURNS: API key header format, base URL, cURL/Python/JavaScript examples.`, inputSchema: { type: "object", properties: {}, }, outputSchema: { type: "object", properties: { content: { type: "array", items: { type: "object", properties: { type: { type: "string", enum: ["text"] }, text: { type: "string", description: "Markdown with: API Key Usage header name, Base URL, Getting Your API Key steps, Request Examples (cURL, Python, JavaScript code blocks)" } } } } } } }, ], }));