NewAPIVerve Academy: free courses and certifications anyone can verify.Explore the Academy →

Cryptogram Generator API

GET

Create ready-to-solve cipher puzzles from custom text or quotes.

Cryptogram Generator creates letter substitution cipher puzzles where each letter is replaced with another letter consistently throughout the text.

Try it — live request, no key required

Request
GETapi.apiverve.com/v1/cryptogram?random=true
Query parameters
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "status": "ok",
  "error": null,
  "data": {
    "encoded": "PNR MJSXQRV JI K PNJSGKQC DBFRG ARWBQG ZBPN K GBQWFR GPRY",
    "original": "The journey of a thousand miles begins with a single step",
    "cipher": {
      "A": "K",
      "B": "A",
      "C": "H",
      "D": "C",
      "E": "R",
      "F": "I",
      "G": "W",
      "H": "N",
      "I": "B",
      "J": "M",
      "K": "E",
      "L": "F",
      "M": "D",
      "N": "Q",
      "O": "J",
      "P": "Y",
      "Q": "T",
      "R": "X",
      "S": "G",
      "T": "P",
      "U": "S",
      "V": "L",
      "W": "Z",
      "X": "O",
      "Y": "V",
      "Z": "U"
    },
    "letterCount": 47,
    "wordCount": 11,
    "html": "<html><head><title>Cryptogram Puzzle</title><style>body {font-family: Arial, sans-serif; padding: 20px; max-width: 800px; margin: 0 auto;}h1 {text-align: center;}.puzzle {font-family: monospace; font-size: 24px; letter-spacing: 3px; line-height: 2.5; word-wrap: break-word;}.letter-box {display: inline-block; text-align: center; margin: 2px;}.encoded {border-bottom: 2px solid #333; min-width: 20px; display: block;}.answer {color: #ccc; font-size: 14px;}.space {width: 15px; display: inline-block;}.hint {margin-top: 30px; padding: 15px; background: #f5f5f5; border-radius: 5px;}.hint h3 {margin-top: 0;}</style></head><body><h1>Cryptogram</h1><div class='puzzle'><span class='letter-box'><span class='encoded'>P</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>N</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>R</span><span class='answer'>_</span></span><span class='space'></span><span class='letter-box'><span class='encoded'>M</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>J</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>S</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>X</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>Q</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>R</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>V</span><span class='answer'>_</span></span><span class='space'></span><span class='letter-box'><span class='encoded'>J</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>I</span><span class='answer'>_</span></span><span class='space'></span><span class='letter-box'><span class='encoded'>K</span><span class='answer'>_</span></span><span class='space'></span><span class='letter-box'><span class='encoded'>P</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>N</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>J</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>S</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>G</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>K</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>Q</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>C</span><span class='answer'>_</span></span><span class='space'></span><span class='letter-box'><span class='encoded'>D</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>B</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>F</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>R</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>G</span><span class='answer'>_</span></span><span class='space'></span><span class='letter-box'><span class='encoded'>A</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>R</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>W</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>B</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>Q</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>G</span><span class='answer'>_</span></span><span class='space'></span><span class='letter-box'><span class='encoded'>Z</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>B</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>P</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>N</span><span class='answer'>_</span></span><span class='space'></span><span class='letter-box'><span class='encoded'>K</span><span class='answer'>_</span></span><span class='space'></span><span class='letter-box'><span class='encoded'>G</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>B</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>Q</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>W</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>F</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>R</span><span class='answer'>_</span></span><span class='space'></span><span class='letter-box'><span class='encoded'>G</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>P</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>R</span><span class='answer'>_</span></span><span class='letter-box'><span class='encoded'>Y</span><span class='answer'>_</span></span></div><div class='hint'><h3>Letter Frequency:</h3><p>R=6, G=5, P=4, Q=4, B=4, N=3, J=3, K=3, S=2, F=2, W=2, M=1, X=1, V=1, I=1, C=1, D=1, A=1, Z=1, Y=1</p></div></body></html>",
    "image": {
      "imageName": "0afa5de4-52fb-4902-8139-c177c08ac98b_puzzle.png",
      "format": ".png",
      "downloadURL": "https://storage.googleapis.com/apiverve/APIData/cryptogram/0afa5de4-52fb-4902-8139-c177c08ac98b_puzzle.png?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1766010132&Signature=guv7GNCup4lJXTI0iCF7Bo2Cz02Wl6h2HWC0YxJ0jtzb7w%2BlW80b1OzBlGR%2BneFxFdzQPwfIuMQlaHsW0KFqPh5ITsFkSt802OEUFyxuiDn71y4XkiJx8zVDhrxNH9R9i1befMM16c%2F4WQGpgzkaaXw8TJJUT2q2s8c8ESo41K85iYcHJZ%2BGUxXeMeFDJ%2FG38pq5txarX%2F0rnmdTk0Jk%2BhEox9PXFPCzaSvWbDFYDVABIt97N2NQyqlDPRcucrm5uuE5Jb9qjT80JqzlumfqiaR3DpgPDwZkWeVyuYW4b4TZCCbbEpK%2FIlRRUZTw9gYdxDpk0B35NKN9WKSCi%2BfFWQ%3D%3D",
      "expires": 1766010132300
    },
    "solutionImage": {
      "imageName": "41e6b5b7-d98c-4d4d-8b44-f56bdb5160b9_solution.png",
      "format": ".png",
      "downloadURL": "https://storage.googleapis.com/apiverve/APIData/cryptogram/41e6b5b7-d98c-4d4d-8b44-f56bdb5160b9_solution.png?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1766010132&Signature=YKDpJF9MYlmXjASdgVUgtPCq8%2Fp59Eci6DIAbXuHzv9B4rALSZwyq1sMj9KoIRhryYCdNW1KGBRpcgJFSFgaEGfcNC1MNsryoV%2F7bp3TSr1%2BknwqAGQu7sWvZrtozB2oJ3Wzaqz%2BGjm74rhrOaqAx0w7%2BmJtimslEHCl8emRuZxmAhW9l8Wi%2Fv%2BsCmb7%2Bl5hj0njHSs6AWo3YtoZpWoNv7F49g1dQczrfj%2BFYW7bOoFMfcmysTz%2ByNpXECZFbvWJ3A2f0fql7itGLGK%2B%2BNlI6Q6WkQ1ye3c7skHB3DqT%2BWHLbJCm0vjbIVhIgq3Vo39ZADdogcd7uiklvEBriMFkwA%3D%3D",
      "expires": 1766010132645
    }
  }
}

About the Cryptogram Generator API

A cryptogram generator for letter substitution puzzles. Send a sentence, or let the API pick a famous quote, and every letter is swapped for another using one random cipher key, with the same letter always becoming the same code letter. Spaces and punctuation stay where they are, so the shape of each word gives solvers their first foothold.

The Free plan returns the encoded text together with the original, plus letter and word counts. That is enough for a puzzle app or a daily brain teaser that checks answers itself, since the original is the solution.

Paid plans add the cipher key as an A-Z mapping, which lets you build hint buttons that reveal one letter at a time. They also add a printable HTML page with a blank under each code letter and a letter frequency analysis of the puzzle, and, on request, downloadable puzzle and solution images in PNG. These suit code-breaking lessons in a classroom, puzzle pages in a newsletter, and print-ready worksheets.

How it works

The cipher is a fresh random permutation of A-Z, built with a Fisher-Yates shuffle on every request. A second pass swaps any letter that landed on itself with its neighbour, so letters are not left encoding to themselves. The text is uppercased and each letter replaced through the key; accented Latin letters are first folded to their base letter (É becomes E), and digits, spaces and punctuation pass through unchanged. Text with no letters A-Z after folding returns a 400. encoded is therefore all capitals, while original keeps the case you sent. Because the key is redrawn each time, the same text produces a different puzzle on every call.

If text is empty or missing, or random is explicitly true, text is ignored and a quote is drawn at random from a collection of over 5,000 attributed quotes (the same collection Random Quote serves), with a small built-in set as a fallback. The quote's attribution comes back as author, and encodedAuthor is that attribution enciphered with the same key, for puzzles printed in the newspaper style where the author line is part of the cipher. Both are null for your own text, and author is also null when the quote's author is unknown. Random quotes keep their original punctuation. letterCount counts only the letters A-Z in the original after accent folding, and wordCount splits it on whitespace.

cipher maps each plain letter to its code letter: "A": "K" means every A in the original appears as K in encoded. To decode, invert the mapping. The html page shows the encoded text with a blank under each code letter, followed by a frequency table of the code letters sorted from most to least common, the usual starting point for solving by hand.

On the Free plan cipher and html are null and the image and solutionImage parameters are removed. On paid plans image=true renders the puzzle and solutionImage=true renders the same grid with the answers filled in. Each comes back as a PNG with imageName, a signed downloadURL and an expires timestamp one day after the call.

What people use it for

Puzzle Publishing
Create cryptogram puzzles for newspapers, magazines, and puzzle books
Educational Content
Teach cryptography and pattern recognition through interactive puzzles
Brain Training
Develop logical thinking and deductive reasoning exercises
Entertainment
Generate party games and group activities

Ways to call it

One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.

JSON
Default REST response
XML
Markup format
YAML
Human-readable
CSV
Tabular export
Beta
GraphQL
Query language
New
MCP
For AI agents

Other ways to use Cryptogram Generator

Same data, same APIVerve account, same credit balance — one key works on all of them.

Questions.

Common questions about the Cryptogram Generator API.

Read the docs →
Can I use my own text or does it only generate random puzzles?
You can supply your own custom text up to 500 characters or set the random parameter to true to generate a puzzle from one of over 5,000 attributed quotes, returned with its author both in plain text and enciphered. In both cases, the Cryptogram Generator creates a consistent substitution cipher across all letters in the passage.
Does the generator provide ready-to-print puzzle images?
Yes, on paid plans. When requested, the endpoint produces downloadable puzzle images and complete solution keys in standard formats like PNG or JPEG. The response provides signed download URLs, unique image filenames, and URL expiration timestamps.
Are the cipher key and downloadable images included on the Free plan?
No. The substitution cipher mapping, interactive HTML puzzle layout, and downloadable puzzle and solution images are premium features unlocked on any paid plan. The Free plan returns the encoded puzzle text, original text, and basic letter and word counts.
What happens if a phrase exceeds 500 characters?
The text parameter has a hard limit of 500 characters per call. If you have longer passages or full articles, split the text into segments under 500 characters before sending each request.
Which plan fits 25,000 generated puzzles a month?
The Starter plan handles this volume easily. At 1 credit per puzzle, 25,000 generations require 25,000 credits, using an eighth of Starter's 200,000 monthly credits. That volume works out to about $0.15 per 1,000 puzzles, while the Free plan allows 200 calls per month.

Ready to build with Cryptogram Generator? Start with 200 free credits — one key unlocks all 404+ APIs.

Explore the catalog

404+ APIs on the same key and the same response shape.

Browse all APIs