---
title: "QR code API for agents and scripts · QRsome"
description: "Generate QR codes with your shape, color and logo over an HTTP API or an MCP server: send JSON, get the SVG and PNG back."
url: https://qrsome.com/use/qr-code-api/
language: en
---

Guide

# How to generate styled QR codes from your own agent or a script

Every QRsome account has an HTTP API and an MCP server. Send the content and the look as JSON and get back links to the SVG and PNG, or the image itself; your saved look applies unless you send another one.

## What to ask

Type it in your own words; these work as they are:

- curl -X POST 'https://qrsome.com/api/qr?format=png' -H 'Authorization: Bearer sk_qr_…' -H 'Content-Type: application/json' -d '{"data":"https://example.com","fg":"#1f2a4d","shape":"dots"}' -o qr.png

## What you get

JSON with the code's id and links to its SVG and PNG, or, with ?format=png, the PNG bytes themselves.

## How to do it

First time? Connect QRsome to ChatGPT, Claude or your own agent once; it takes a minute. [How to connect](https://qrsome.com/connect/index.md)

1. Sign in and create an API key on your account page.
2. POST /api/qr with {"data": "https://example.com", "shape": "dots"} and the key as a Bearer token.
3. Add ?format=png to get the PNG bytes in the response. Your saved look applies unless you send look.
4. Point an agent at the MCP server with the same key when it should choose the code for itself.

## Questions

**Where is the API reference?**

On the API page of this site, with every endpoint, request and response field.

**Can my agent use the MCP server instead of the API?**

Yes. The MCP server accepts the same API key as a Bearer token, or the OAuth sign-in an assistant uses.

## What it costs

Free QR codes. Codes you create keep working. [Connect an agent](https://qrsome.com/connect/index.md)

## Connect QRsome to your assistant

Add the URL in Claude, ChatGPT or Cursor, sign in once, then ask in plain words.

`https://qrsome.com/mcp`

## More guides

[Guides](https://qrsome.com/use/index.md)

- [How to send each customer a QR code for their booking from your own agent](https://qrsome.com/use/booking-qr-code-from-your-agent/index.md)
- [How to make many QR codes at once, for tables or products](https://qrsome.com/use/bulk-qr-codes/index.md)
- [How to make a QR code with your logo and brand colors](https://qrsome.com/use/brand-kit-qr-codes/index.md)
- [How to make a QR code in ChatGPT](https://qrsome.com/use/qr-code-in-chatgpt/index.md)
- [How to make a QR code in Claude](https://qrsome.com/use/qr-code-in-claude/index.md)
- [How to make a QR code you can change after printing](https://qrsome.com/use/editable-qr-code/index.md)
- [How to see how many people scanned your flyer or poster](https://qrsome.com/use/flyer-qr-code-scan-tracking/index.md)
- [QRsome vs subscription QR generators](https://qrsome.com/vs/subscription-qr-generators/index.md)
- [QRsome home](https://qrsome.com/index.md)
