Skip to main content
Widgets can call DeepSpace’s integration APIs to access external services — text generation, Google Calendar, web search, image processing, and more. All requests go through the mcapi client, which handles auth and (in canvas mode) user approval.

The mcapi Client

mcapi is the API client provided by the SDK. It handles authentication, environment detection, and the approval flow automatically.
import { mcapi } from '@spaces/sdk'

const result = await mcapi.post('generate-text', {
  prompt: 'Write a haiku about coding',
})
You use mcapi.post(endpoint, body) or mcapi.get(endpoint). The client:
  1. Prepends the correct API base URL (auto-detected per environment)
  2. Attaches the user’s auth token
  3. In canvas mode, triggers the approval flow for credit-consuming endpoints
  4. Returns the response data

Free Endpoints

Some endpoints are auto-approved and never trigger the modal — typically read-only or non-credit-consuming routes like social profile lookups.

Standalone Mode

When a widget is deployed as a standalone site, there is no approval flow. API calls go directly to the server with the user’s auth token.

Available API Categories

The full list of endpoints with parameters is available at runtime via GET /api/integrations/routes-schema (returns JSON Schema) and GET /api/integrations/catalog.

AI & Content Generation

EndpointDescription
generate-textText generation via LLMs
generate-imageImage generation (async, auto-selects model)
generate-image-classicFast image generation (Classic model)
generate-image-mysticUltra-realistic images (Freepik Mystic)
generate-image-flux-devFlux Dev model
generate-image-flux-proFlux Pro v1.1 model
generate-image-hyperfluxHyperflux model
generate-image-seedreamSeedream v3 model
generate-image-seedream-v4Seedream v4 model
generate-image-gptOpenAI GPT image models
generate-videoVideo generation from image + prompt
text-to-speechConvert text to audio
speech-to-textTranscribe audio to text
submagic-create-videoAI video creation (async)

Search & Research

EndpointDescription
search-web-aiWeb search with custom AI prompt
search-webWeb search with AI summarization
search-web-rawWeb search (raw results)
advanced-web-searchMulti-modal web search
exa-searchExa AI neural search
exa-find-similarFind similar pages via Exa
exa-contentsGet full page contents for URLs
exa-answerLLM answer informed by Exa search
exa-researchAsync research task (up to 10 min)
search-imagesImage search
search-videosVideo search
search-pdfsPDF document search
search-academicAcademic content search (.edu)
firecrawl-scrapeScrape a single URL
firecrawl-crawlCrawl multiple URLs
firecrawl-mapMap site structure
firecrawl-searchSearch crawled content
scholar-search-papersGoogle Scholar paper search
scholar-search-authorsGoogle Scholar author search
scholar-summarize-papersSummarize papers via LLM
scholar-get-citation-detailsGet detailed citation info
scholar-draft-emailDraft outreach email via LLM
wikipedia-summaryWikipedia page summary
wikipedia-searchSearch Wikipedia articles
news-top-headlinesTop news headlines
news-searchSearch news articles

Google Services

EndpointDescription
google-calendar-eventsList calendar events
google-calendar-create-eventsCreate calendar events
send-emailSend email via Gmail
gmail-replyReply to Gmail threads
drive-listList Google Drive files
drive-uploadUpload to Google Drive
drive-downloadDownload from Google Drive
drive-deleteDelete from Google Drive
google-contactsFetch Google contacts

Slack

EndpointDescription
slack-channelsList Slack channels
slack-send-messageSend a message
slack-channel-historyGet channel message history
slack-team-infoGet team information

Image Processing

EndpointDescription
remove-backgroundRemove image backgrounds
upscale-imageEnhance image resolution
style-transfer-imageApply artistic styles from reference
expand-imageOutpaint / extend image borders
relight-imageAdjust lighting
search-iconsSearch Freepik icons
download-iconDownload a Freepik icon
search-stock-imagesSearch stock photos
download-stock-imageDownload a stock photo
search-stock-videosSearch stock footage
download-stock-videoDownload stock footage

Social & Professional

EndpointDescription
linkedin-search-profilesLinkedIn profile search
linkedin-analyze-profilesAnalyze profiles for outreach
linkedin-generate-messagesGenerate outreach messages
instagram-extract-contentExtract Instagram content
tiktok-post-videoPost video to TikTok
youtube-searchYouTube video search
youtube-video-detailsGet video details
youtube-trendingGet trending videos
github-search-repositoriesSearch GitHub repos
github-get-repositoryGet repo information
github-get-repository-commitsGet repo commits
github-get-repository-issuesGet repo issues
github-get-repository-pullsList pull requests
github-get-repository-treeGet file tree
github-get-repository-contentsGet file/directory contents

Data & Markets

EndpointDescription
polymarket-eventsPrediction market events
polymarket-searchFull-text search events/markets
polymarket-price-historyHistorical price data
polymarket-orderbookOrderbook depth
search-stocksSearch stock symbols
search-cryptoSearch cryptocurrencies
amazon-searchProduct search

Sports

Endpoint prefixDescription
football/*Soccer — leagues, teams, fixtures, standings, transfers, injuries, predictions
basketball/*Basketball — leagues, teams, games, standings, player stats
nfl/*American football — leagues, teams, games, standings, player stats
baseball/*Baseball — leagues, teams, games, standings
f1-*Formula 1 — schedules, standings, lap times, pit stops, qualifying, sprint

Science, Weather & Travel

EndpointDescription
weather-forecast5-day weather forecast
current-weatherCurrent conditions
geocode-cityGeocode a city name
nasa-apodAstronomy Picture of the Day
nasa-neows-feedNear-Earth Objects feed
flightsFlight search (SerpAPI)
serp-hotelsHotel search
serp-placesPlace search
serp-eventsEvent search
mta-subway-arrivalsNYC subway real-time arrivals
mta-subway-alertsNYC subway service alerts

Real-Time Communication

EndpointDescription
livekit-create-roomCreate a LiveKit video/audio room
livekit-join-roomJoin a room (get access token)
livekit-list-participantsList room participants

Widget Discovery

Widgets can discover other widgets on the same canvas without API calls:
window.parent.postMessage({ type: 'GET_CANVAS_WIDGETS' }, '*')

window.addEventListener('message', (event) => {
  if (event.data.type === 'CANVAS_WIDGETS_RESPONSE') {
    const widgets = event.data.widgets
    // [{ id, shapeId, templateHandle, templateName, icon }, ...]
  }
})

Widget-to-Widget Communication (I/O)

Widgets can be connected to each other via an input/output system. This lets data flow between widgets visually on the canvas.
  • Outputs (red slot, right side) — A widget emits data
  • Inputs (blue slot, left side) — A widget receives data
  • Connections are drawn visually on the canvas and stored in canvas state
// Emit an output value
window.parent.postMessage({
  type: 'widget-io-output-update',
  slotId: 'output-1',
  value: { data: computedResult },
}, '*')

// Listen for input values
window.addEventListener('message', (event) => {
  if (event.data.type === 'widget-io-input-update') {
    const { slotId, value } = event.data
    // Use the incoming data
  }
})
This system is useful for building pipelines — for example, a data-fetcher widget feeding into a chart widget.