Generate a vector SVG QR code on the fly without saving it to database.
API endpoint:
https://2if.net/api/v1/qr-codes/generate
Request example (JSON Data URL output):
curl --location --request POST 'https://2if.net/api/v1/qr-codes/generate' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'text=https://example.com' \
--data-urlencode 'size=300' \
--data-urlencode 'color=#000000' \
--data-urlencode 'response_type=json'
textsizecolorbg_colormarginerror_correctionresponse_typeGenerate a standard Code-128 linear 1D barcode vector SVG for products, inventory, SKUs, or tracking numbers.
API endpoint:
https://2if.net/api/v1/barcodes/generate
Request example:
curl --location --request POST 'https://2if.net/api/v1/barcodes/generate' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'text=PRD-99812' \
--data-urlencode 'height=60' \
--data-urlencode 'show_text=1'
texttypeheightwidthshow_textcolorresponse_typeAPI endpoint:
https://2if.net/api/v1/qr-codes
Request example:
curl --location --request GET 'https://2if.net/api/v1/qr-codes' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
API endpoint:
https://2if.net/api/v1/qr-codes
Request example:
curl --location --request POST 'https://2if.net/api/v1/qr-codes' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'name=My Campaign QR' \
--data-urlencode 'url=https://example.com/promo'
nameurllink_idstyleRetrieve details and configuration of a specific saved QR code belonging to your account.
API endpoint:
https://2if.net/api/v1/qr-codes/{id}
Request example:
curl --location --request GET 'https://2if.net/api/v1/qr-codes/{id}' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer {api_key}'
Response example:
{
"data": {
"id": 12,
"name": "Summer Campaign",
"url": "https://example.com/summer",
"link_id": 45,
"short_url": "https://2if.test/summer26",
"style": {
"color": "#176b5b",
"bg_color": "#ffffff"
},
"created_at": "2026-10-14T12:00:00.000000Z",
"updated_at": "2026-10-14T12:00:00.000000Z"
},
"status": 200
}
Update the name, destination URL, or styling of an existing QR code.
API endpoint:
https://2if.net/api/v1/qr-codes/{id}
Request example:
curl --location --request PUT 'https://2if.net/api/v1/qr-codes/{id}' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer {api_key}' \ --data-urlencode 'name=Updated Summer Campaign' \ --data-urlencode 'url=https://example.com/autumn'
nameurlstyleDirectly fetches the rendered vector SVG image for a saved QR code. Ideal for embedding into web pages, mobile apps, or design tools.
API endpoint:
https://2if.net/api/v1/qr-codes/{id}/image
Request example:
curl --location --request GET 'https://2if.net/api/v1/qr-codes/{id}/image?size=400' \ --header 'Authorization: Bearer {api_key}' \ --output qrcode.svg
HTML embed example:
<img src="https://2if.net/api/v1/qr-codes/12/image?size=300" width="300" height="300" alt="QR Code" />
sizePermanently removes a QR code from your account. Due to strict user isolation (ownership check), you can only delete QR codes that belong to your account.
API endpoint:
https://2if.net/api/v1/qr-codes/{id}
Request example:
curl --location --request DELETE 'https://2if.net/api/v1/qr-codes/{id}' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer {api_key}'
Response example:
{
"id": 12,
"object": "qr_code",
"deleted": true,
"status": 200
}