DEV Community

Alex Spinov
Alex Spinov

Posted on

Vercel Has a Free API — Deploy, Manage Domains, and Set Env Vars Programmatically (No Credit Card)

Most developers know Vercel for deploying Next.js apps. But Vercel also has a REST API that lets you manage deployments, domains, environment variables, and logs programmatically.

Free tier: 100 GB bandwidth, serverless functions, edge functions, unlimited deployments from CLI or API. No credit card.

Here's what you can do with the API — and the code to get started.

What the API Covers

Endpoint What it does
/v13/deployments Create, list, delete deployments
/v9/projects Manage projects and env vars
/v4/domains Add, verify, configure domains
/v1/integrations Manage marketplace integrations
/v2/user Account info, usage stats

Quick Start: List Your Deployments

# Get your token: vercel.com/account/tokens
export VERCEL_TOKEN="your_token_here"

# List recent deployments
curl -s -H "Authorization: Bearer $VERCEL_TOKEN"   "https://api.vercel.com/v6/deployments?limit=5" | jq '.deployments[] | {name, url, state, created}'
Enter fullscreen mode Exit fullscreen mode

Output:

{
  "name": "my-nextjs-app",
  "url": "my-nextjs-app-abc123.vercel.app",
  "state": "READY",
  "created": 1711411200000
}
Enter fullscreen mode Exit fullscreen mode

Deploy From CLI (One Command)

npx vercel --yes --token $VERCEL_TOKEN
Enter fullscreen mode Exit fullscreen mode

This deploys the current directory. No config file needed. Vercel auto-detects Next.js, Vite, Astro, SvelteKit, Remix, or static HTML.

Deploy via API (Programmatic)

const deploy = await fetch('https://api.vercel.com/v13/deployments', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.VERCEL_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'my-api',
    files: [
      {
        file: 'api/hello.js',
        data: Buffer.from('export default (req, res) => res.json({ hello: "world" })').toString('base64'),
        encoding: 'base64',
      },
    ],
    projectSettings: {
      framework: null,
    },
  }),
});

const result = await deploy.json();
console.log(`Deployed: https://${result.url}`);
Enter fullscreen mode Exit fullscreen mode

Manage Environment Variables

# Set env var for production
curl -X POST "https://api.vercel.com/v10/projects/my-project/env"   -H "Authorization: Bearer $VERCEL_TOKEN"   -H "Content-Type: application/json"   -d '{"key": "DATABASE_URL", "value": "postgres://...", "target": ["production"], "type": "encrypted"}'
Enter fullscreen mode Exit fullscreen mode

Vercel vs. Netlify vs. Cloudflare Pages

Feature Vercel Netlify Cloudflare Pages
Free bandwidth 100 GB 100 GB Unlimited
Serverless functions ✅ (Node, Go, Python, Ruby) ✅ (Node, Go) ✅ (Workers, JS only)
Edge functions ✅ (native)
API access ✅ full REST API
Deploy from API
Framework detection Auto (30+ frameworks) Auto Manual
Cold start ~250ms ~500ms ~0ms (edge)

Choose Vercel if: You use Next.js or want the best DX with auto-framework detection.
Choose Netlify if: You want form handling, identity, and CMS built in.
Choose Cloudflare if: You want unlimited bandwidth and true edge-first compute.

Free Tier Limits

Resource Free
Bandwidth 100 GB/mo
Builds 6,000 min/mo
Serverless execution 100 GB-hours/mo
Edge function invocations 1M/mo
Team members 1 (Hobby plan)

For 99% of side projects, you will never hit these limits.

The Bottom Line

Vercel's API turns deployment into a single API call. Combined with the generous free tier, it is the fastest way to get code live. If you are building with Next.js, there is no better option.

Try it: Sign up at vercel.com, create a token, and deploy in under a minute.


Building something that needs data extraction, web scraping, or custom API integration? I have built 77+ production scrapers. Email Spinov001@gmail.com — quote in 2 hours.

More free developer tools: awesome-web-scraping (9 stars, 150+ tools) | 640+ articles on Dev.to

Top comments (0)