GnistAI GnistAI
Log in

Getting Started with QR Code

Generate QR code image URLs via goqr.me — encode text, URLs, or data with customizable size, format, colors, and error correction.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Utilities

Data source: goqr.me (api.qrserver.com)

Overview

QR Code wraps goqr.me (api.qrserver.com), handling authentication, pagination, and rate limits for you. This tutorial covers all 4 tools with working code examples you can copy and run.

Prerequisites

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "mcpServers": {
    "gnist-qr-code": {
      "url": "https://context.gnist.ai/mcp/qr-code/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Tools (4)

generate_qr_code

Generate a QR code URL for the given text or URL. Returns a URL that renders a QR code image. The URL can be used directly in an <img> tag or opened in a browser. No image data is returned — only the URL.

ParameterTypeRequiredDescription
datastringrequiredThe text or URL to encode in the QR code.
sizeintegeroptionalImage size in pixels (10-1000). (default: 200)
formatstringoptionalImage format: png, gif, jpeg, svg, eps. (default: png)
error_correctionstringoptionalError correction level: L, M, Q, H. (default: M)
colorstringoptionalQR code color as hex (e.g. 000000 for black). (default: 000000)
bg_colorstringoptionalBackground color as hex (e.g. ffffff for white). (default: ffffff)
curl -X POST "https://context.gnist.ai/mcp/qr-code/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "generate_qr_code", "arguments": {"data": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/qr-code/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'data': 'example'}, 'name': 'generate_qr_code'}},
)
print(resp.json())

list_qr_formats

List supported QR code image formats. Returns the available output formats for QR code generation.

curl -X POST "https://context.gnist.ai/mcp/qr-code/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "list_qr_formats", "arguments": {}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/qr-code/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {}, 'name': 'list_qr_formats'}},
)
print(resp.json())

list_qr_error_correction_levels

List available QR code error correction levels. Returns the error correction levels (L/M/Q/H) with descriptions of their recovery capability.

curl -X POST "https://context.gnist.ai/mcp/qr-code/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "list_qr_error_correction_levels", "arguments": {}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/qr-code/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {}, 'name': 'list_qr_error_correction_levels'}},
)
print(resp.json())

report_feedback

Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: general)
curl -X POST "https://context.gnist.ai/mcp/qr-code/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/qr-code/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())

FAQ

What data does QR Code provide?

Generate QR code image URLs via goqr.me — encode text, URLs, or data with customizable size, format, colors, and error correction. It exposes 4 tools: generate_qr_code, list_qr_formats, list_qr_error_correction_levels, report_feedback.

What do I need to get started?

A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.

What format does the QR Code API return?

JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.

Next Steps

Related Tutorials