Documentation
CORSPORXY Logo

Documentation → general

How to Use CorsProxy

This page covers the recommended URL format, proper URL encoding, and copy-paste examples.

Create a free account in the dashboard and replace YOUR_API_KEY with your CORSPROXY key. Free supports browser JSON, text, and raw feeds on local or published app domains within its limits. Choose a paid plan for additional content types, advanced features, or server-side requests. Use key and url query parameters:

https://corsproxy.io/?key=YOUR_API_KEY&url=<ENCODED_TARGET_URL>

In other words, corsproxy.io/?key=YOUR_API_KEY&url= is the prefix and your encoded target URL goes into the url parameter.

Example:

https://corsproxy.io/?key=YOUR_API_KEY&url=https%3A%2F%2Fapi.github.com%2Fusers%2Foctocat

Always encodeURIComponent() the target URL

If your target URL contains ?, &, spaces, or non-ASCII characters, encode it first:

const targetUrl = 'https://api.example.com/search?q=hello world&type=json';
const proxyUrl = `https://corsproxy.io/?key=YOUR_API_KEY&url=${encodeURIComponent(targetUrl)}`;

const res = await fetch(proxyUrl);

JavaScript (fetch)

const url = 'https://corsproxy.io/?key=YOUR_API_KEY&url=' + encodeURIComponent('https://httpbin.org/get');
const res = await fetch(url);

if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
console.log(data);

cURL

curl "https://corsproxy.io/?key=YOUR_API_KEY&url=https%3A%2F%2Fhttpbin.org%2Fget"

Common mistakes

  • Omitting your CORSPROXY API key or confusing it with the upstream API token.
  • Not encoding the target URL (results in broken query strings).
  • Using the less-compatible direct query format (?https://...) for complex URLs.
  • Treating upstream 403 responses as “CORS errors” (see 403 Forbidden).