Skip to content

API documentation

The full reference, with request and response examples and the OpenAPI specification, is at urlcrop.com/docs/api. It covers authentication, links, QR codes,...

The full reference, with request and response examples and the OpenAPI specification, is at urlcrop.com/docs/api. It covers authentication, links, QR codes, pages, domains, campaigns, analytics queries, webhooks, errors, pagination, idempotency keys and rate limits.

Official SDKs:

  • JavaScript / TypeScript (browser snippet and Node): npm install @urlcrop/sdk
  • Node server SDK: npm install @urlcrop/node
  • PHP and Python SDKs are Coming soon.

Quick example (Node):

import { URLCrop } from "@urlcrop/node";
const uc = new URLCrop({ apiKey: process.env.URLCROP_API_KEY! });
const link = await uc.links.create({ destination: "https://example.com/sale", slug: "sale" });
console.log(link.shortUrl); // https://crop.sh/sale