A simple, general-purpose CORS proxy using Vercel serverless functions
This is a CORS proxy that allows you to make requests to APIs that don't support CORS from your frontend applications. It acts as a middleware between your frontend and the target API, adding the necessary CORS headers to enable cross-origin requests.
📌 Base URL: https://cors-proxy-xi-ten.vercel.app/api/proxy
const proxyUrl = 'https://cors-proxy-xi-ten.vercel.app/api/proxy';
const targetUrl = 'https://api.example.com/data';
fetch(`${proxyUrl}?url=${encodeURIComponent(targetUrl)}`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
const proxyUrl = 'https://cors-proxy-xi-ten.vercel.app/api/proxy';
const targetUrl = 'https://api.example.com/data';
fetch(`${proxyUrl}?url=${encodeURIComponent(targetUrl)}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ key: 'value' })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Want to see the proxy in action or monitor its usage?
This proxy is provided for development and testing purposes. Please use it responsibly and avoid sending sensitive data through it. If you need a more secure solution, consider deploying your own instance.