We build custom applications 5x faster and cheaper š
Book a Free Consultation
Stuck on an error? Book a 30-minute call with an engineer and get a direct fix + next steps. No pressure, no commitment.
Integrate Web Search Plus with OpenClaw by creating a ClawHub skill that performs authenticated API calls to Web Search Plus, configuring authentication (OAuth or API key) in ClawHub and your external services, implementing a small server-side connector to handle OAuth token exchange and secrets, and writing the skillās runtime code to call the Web Search Plus REST endpoints with proper rate limiting, caching, and error handling. Validate webhooks/signatures if Web Search Plus pushes events, keep long-lived state outside the agent (database, cache, scheduler), and debug with logs, HTTP response inspection, and credential/scope checks.
// <b>//</b> Server-side connector: exchange code for token (Node/Express pseudocode)
const express = require('express');
const fetch = require('node-fetch');
const app = express();
app.get('/oauth/callback', async (req, res) => {
const code = req.query.code;
<b>//</b> Exchange code for access token at Web Search Plus token endpoint
const tokenResp = await fetch('https://api.websearchplus.example.com/oauth/token', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
grant_type: 'authorization_code',
code,
redirect_uri: process.env.OAUTH_REDIRECT_URI,
client_id: process.env.CLIENT_ID,
client_secret: process.env.CLIENT_SECRET
})
});
const tokenJson = await tokenResp.json();
<b>//</b> Persist tokenJson.access_token and tokenJson.refresh_token securely
// saveTokensForUser(userId, tokenJson);
res.send('OK');
});
app.get('/proxy/search', async (req, res) => {
const userId = req.query.user;
<b>//</b> Retrieve a valid access token from your store and refresh if needed
const accessToken = await getValidAccessTokenForUser(userId);
const q = encodeURIComponent(req.query.q || '');
const apiUrl = `https://api.websearchplus.example.com/v1/search?q=${q}&limit=10`;
const apiResp = await fetch(apiUrl, {
headers: { Authorization: `Bearer ${accessToken}`, 'Accept': 'application/json' },
// <b>//</b> set timeouts/retries at HTTP client level in production
});
const results = await apiResp.json();
res.json(results);
});
app.listen(3000);
// <b>//</b> Client-side skill runtime calling your proxy (this runs inside the skill)
async function searchWeb(query, userId) {
const resp = await fetch(`https://connector.internal.example.com/proxy/search?q=${encodeURIComponent(query)}&user=${userId}`, {
headers: { 'Authorization': `Bearer ${process.env.SKILL_INTERNAL_TOKEN}` } // <b>//</b> short-lived token for skill-to-connector auth
});
if (!resp.ok) {
throw new Error(`Search failed: ${resp.status}`);
}
return resp.json(); // <b>//</b> normalized result set
}
Speak oneāonāone with a senior engineer about your noācode app, migration goals, and budget. In just half an hour youāll leave with clear, actionable next stepsāno strings attached.
1
Direct answer: A 401 / "Invalid API Key" means the runtimeās outgoing request lacks a valid credential or uses the wrong header/format. Fix by ensuring the exact API key/token stored in the OpenClaw runtime environment or ClawHub skill config matches the provider, is placed in the correct header, and the skill has the required permission scope.
// curl example: adjust header name to provider spec
curl -i -H "Authorization: Bearer $API_KEY" https://api.example.com/endpoint
// Node fetch using env var in runtime
const res = await fetch('https://api.example.com/endpoint', {
headers: { 'Authorization': `Bearer ${process.env.API_KEY}` }
});
2
Direct answer: map Web Search Plus fields into an OpenClaw document by assigning stable identifiers, putting human-readable title/snippet into title and content, preserving URLs and timestamps in url and published_at, and storing provider-specific data in a metadata object for auditing, deduplication, and scoring.
// mapping function
const map = (r) => ({
id: r.cacheId || hash(r.url), // <b>// stable id</b>
title: r.title,
content: r.snippet || r.leadParagraph,
url: r.url,
published_at: r.publishedAt,
metadata: {source:r.source, score:r.relevanceScore, raw:r}
});
3
Handle throttling by breaking the sync into paged/batched requests, honoring provider quotas and Retry-After headers, using exponential backoff with jitter, and moving durable sync state outside the OpenClaw runtime so you can resume without loss.
4
If a browser frontend or ingestion cannot reach an API, start by diagnosing network and CORS: check browser console and server logs, confirm the API responds to preflight OPTIONS and sends proper CORS headers, or avoid CORS by routing requests through a server-side proxy or API gateway; for webhooks expose a reachable URL (ngrok or hosted) and validate signatures; ensure OpenClaw skills are authenticated and check agent logs for errors.
Actionable steps:
This prompt helps an AI assistant understand your setup and guide you through the fix step by step, without assuming technical knowledge.
From startups to enterprises and everything in between, see for yourself our incredible impact.
Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. Weāll discuss your project and provide a custom quote at no cost.Ā