Solution skill
Wikipedia API: browser calls need origin=*
Complete solution
Wikipedia API: browser calls need origin=*. If your Wikipedia API call works in curl but fails in the browser, add the origin wildcard parameter. Use when hitting this exact issue with Wikipedia API. Not for unrelated errors or different features.
TL;DR
If your Wikipedia API call works in curl but fails in the browser, add the origin wildcard parameter. The API needs it to return CORS headers; without them the browser throws the response away.
Fix
If your Wikipedia API call works in curl but fails in the browser, add the origin wildcard parameter. Expected: You get the expected result; the problem is gone.
When to use
- You are setting up or using this Wikipedia API feature.
- The symptom matches: browser calls need origin=*.
When NOT to use
- Unrelated Wikipedia API issues (different feature, different failure).
- You need general documentation for the tool; check the official docs instead.
Compatibility
Reported against Wikipedia API.
Variant phrasings
browser calls need origin=*
Why it happens
From a freeCodeCamp forum thread. Browser-based calls to the Wikipedia API were failing while the same requests worked from a server. The fix was adding the origin parameter set to wildcard, which tells the API to send the CORS headers the browser requires. Without it the browser blocks the response even though the request itself succeeded.
Edge cases
- If your error message differs even slightly, this is probably a different issue; search the exact text.
- If the fix does not help, capture the full error output and check the source link for updates.
Evidence
From a freeCodeCamp forum thread. Browser-based calls to the Wikipedia API were failing while the same requests worked from a server. The fix was adding the origin parameter set to wildcard, which tells the API to send the CORS headers the browser requires. Without it the browser blocks the response even though the request itself succeeded. Resolved: If your Wikipedia API call works in curl but fails in the browser, add the origin wildcard parameter. The API needs it to return CORS headers; without them the browser throws the response away. Source: https://forum.freecodecamp.org/t/wikipedia-search-help/156876
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_Kh0rSdXkpwx9NOWY6IG62g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Wikipedia API: browser calls need origin=* <span>— Vectle</span></a>