Developers

Developer Guide: APIs and Embeddable Search Widgets

InfoSpace TeamDecember 10, 202510 min read
Back to Blog
Developer Guide: APIs and Embeddable Search Widgets

InfoSpace Team · InfoSpace

Share:

Introduction

InfoSpace provides powerful integration options for developers who want to incorporate curated search into their applications. Whether you're building a documentation site, internal tool, or public resource hub, our API and embed features make it easy.

This guide covers everything you need to know to get started.

Embed Widget

The simplest way to add InfoSpace search to your site is through our embed widget.

Basic Embed

Add a search interface to any webpage with a single iframe:

<iframe 
  src="https://infospace.io/embed/your-search-engine-slug"
  width="100%"
  height="600"
  frameborder="0"
  style="border-radius: 8px;"
></iframe>

Customization Options

Customize the embed appearance with URL parameters:

ParameterDescriptionExample
themeLight or dark modetheme=dark
bgBackground color (hex without #)bg=1a1a2e
textText colortext=ffffff
accentAccent/primary coloraccent=6366f1
cardBgCard background colorcardBg=2a2a4e
radiusBorder radius (sm, md, lg, none)radius=lg
fontFont familyfont=inter

Example with Customization

<iframe 
  src="https://infospace.io/embed/my-engine?theme=dark&accent=22c55e&radius=lg"
  width="100%"
  height="600"
  frameborder="0"
></iframe>

REST API

For more control, use our REST API to query search engines programmatically.

Authentication

Public endpoints don't require authentication. For private search engines and write operations, include your API key:

Authorization: Bearer your_api_key_here

Public Endpoints

#### List Public Search Engines

GET /api/search-engines

Response:

{
  "searchEngines": [
    {
      "id": "uuid",
      "name": "My Search Engine",
      "slug": "my-search-engine",
      "description": "A curated collection of resources",
      "icon": "🔍",
      "is_public": true,
      "created_at": "2025-01-01T00:00:00Z"
    }
  ]
}

#### Get Search Engine by Slug

GET /api/search-engines/:slug

#### Get Links in Search Engine

GET /api/search-engines/:slug/links

#### Search Within Engine

GET /api/search-engines/:slug/search?q=your+query

Response:

{
  "searchEngine": { "id": "...", "name": "..." },
  "query": "your query",
  "results": [
    {
      "id": "uuid",
      "url": "https://example.com",
      "title": "Example Resource",
      "description": "A great resource",
      "favicon": "https://example.com/favicon.ico",
      "category": "Documentation",
      "tags": ["tutorial", "beginner"]
    }
  ],
  "count": 1
}

Private API Endpoints

Access your private search engines and manage links:

#### List Your Search Engines

GET /api/me/search-engines
Authorization: Bearer your_api_key

#### Create Link

POST /api/links
Authorization: Bearer your_api_key
Content-Type: application/json

{
  "url": "https://example.com",
  "title": "Example",
  "description": "Optional description",
  "category": "Resources",
  "tags": ["tag1", "tag2"]
}

Rate Limits

  • Public endpoints: 100 requests per minute
  • Authenticated endpoints: 1000 requests per minute
  • Search queries: 60 per minute
  • Error Handling

    All errors return consistent JSON:

    {
      "error": "Error message here"
    }

    Common status codes:

  • 400 - Bad request (missing parameters)
  • 401 - Unauthorized (invalid/missing API key)
  • 404 - Resource not found
  • 429 - Rate limit exceeded
  • 500 - Server error
  • Use Cases

    Documentation Sites

    Embed a curated documentation search alongside your docs:

    // React example
    function DocSearch() {
      return (
        <iframe 
          src="https://infospace.io/embed/my-docs"
          className="w-full h-96 rounded-lg"
        />
      );
    }

    Internal Tools

    Build custom search interfaces using the API:

    async function search(query) {
      const response = await fetch(
        `https://infospace.io/api/search-engines/internal-resources/search?q=${query}`,
        {
          headers: {
            'Authorization': `Bearer ${API_KEY}`
          }
        }
      );
      return response.json();
    }

    Browser Extensions

    Create browser extensions that search your curated collections:

    chrome.omnibox.onInputEntered.addListener(async (text) => {
      const results = await searchInfoSpace(text);
      // Handle results...
    });

    Slack/Discord Bots

    Build bots that search your knowledge base:

    bot.on('message', async (msg) => {
      if (msg.content.startsWith('!search')) {
        const query = msg.content.slice(8);
        const results = await searchInfoSpace(query);
        msg.reply(formatResults(results));
      }
    });

    Best Practices

  • Cache responses: Reduce API calls by caching search results
  • Handle errors gracefully: Always check response status
  • Respect rate limits: Implement backoff strategies
  • Use webhooks (coming soon): React to changes in real-time
  • Getting API Keys

  • Sign in to InfoSpace
  • Navigate to Settings → API Keys
  • Create a new key with appropriate permissions
  • Store securely—keys are shown only once
  • Support

    Need help with your integration?

  • Check our API reference at /api
  • Join our developer community
  • Contact support@infospace.app
  • We're excited to see what you build with InfoSpace!

    Stay Updated

    Get the latest articles and product updates delivered to your inbox.