Starter
$29/ month
100 patterns included
Round black: all 4 each
- $0.40 per extra pattern
- 20 new patterns a minute
- 2 running at once
String Art API
Send a photo and a few settings. Get back the same patterns String Art App makes: the nail sequence, a preview, a printable nail template and a step-by-step PDF. You own what you generate, including for commercial use.
photo.jpg
POST /api/v1/patterns
1 call, billed as 1 pattern
AAlgorithm A
BAlgorithm B
CAlgorithm C
DAlgorithm D
each: sequence · preview · PDF, + one nail template.pdf
What every call returns
Every nail in order, numbered from 1 like the printed template, plus wrap directions.
A true-to-life JPG of the finished piece to show your customer.
A printable PDF at real size, so nails land in the right place.
The full sequence laid out for building by hand.
How it works
Sign in with your String Art App account. Sandbox keys are free.
Shape, size, nails, lines and thread color. The call answers right away with a pattern id.
Most are ready in 5 to 20 seconds. Check back, or get a webhook.
Free with every pattern
Add our free player to your page and any pattern strings itself in front of your customer, the way it will on their wall. Switch between the algorithms, scrub to any thread, or slow it down.
Pricing
One pattern is one call that succeeds. Failed calls are never charged.
4 for the price of 1
Black and white thread patterns, round or rectangular, are made with all four algorithms, A to D: four different looks from the same photo, and you pay for one pattern. Show your customer all four and let them pick. Want only one? Name it and the pattern is ready sooner, at the same price. Color patterns use one algorithm.
$29/ month
100 patterns included
Round black: all 4 each
Most popular
$99/ month
500 patterns included
Round black: all 4 each
$349/ month
2,500 patterns included
Round black: all 4 each
$1,000+/ month
Custom volume and terms
25 test patterns a month to build your integration. Previews and PDFs are stamped “SANDBOX” and are not for production use or sale. 5 new patterns a minute, 1 at a time.
50 patterns with no stamp, ready to sell, valid for 12 months. No subscription. 20 new patterns a minute, 2 at a time.
Plans renew monthly and can be switched any time (the difference is prorated). Unused included patterns do not roll over. Pack credits are used before overage on a plan. Prices are in US dollars; tax is added where it applies.
Your API
Loading your account…
Use your String Art App account. One sign-in covers the app and this page.
No account yet? Create one in the app, then come back here.
Signed in as
Keys are shown once when you create them. Keep them on your server, never in an app or web page.
Copy your new key now. It will not be shown again.
Buy another 50-pattern pack ($25) automatically when your pack balance gets low, so your patterns never stop. Your card is saved by Stripe; we never see the card number. We email you after every automatic purchase.
Stop new patterns once this many have been made in a billing month, so overage never surprises you. Leave it empty for no limit.
Webhooks are part of Growth and Business. Use this secret to check the StringArt-Signature header.
••••••••••••••••
| Pattern | Status | Billed as | Created |
|---|
Docs
status: "queued".status is succeeded (most take 5 to 20 seconds), or use a webhook.# 1. Send a photo
curl https://stringartapp.com/api/v1/patterns \
-H "Authorization: Bearer $STRINGART_KEY" \
-H "Idempotency-Key: order-1042" \
-F image=@photo.jpg \
-F 'settings={"shape":"circular","nails":220,"lines":3000,"diameter_cm":60}'
# 2. Read it back until status is "succeeded"
curl https://stringartapp.com/api/v1/patterns/pat_... \
-H "Authorization: Bearer $STRINGART_KEY"
// Node 18 or newer
import { readFile } from 'node:fs/promises';
const API = 'https://stringartapp.com/api/v1/patterns';
const auth = { Authorization: `Bearer ${process.env.STRINGART_KEY}` };
const form = new FormData();
form.append('image', new Blob([await readFile('photo.jpg')]), 'photo.jpg');
form.append('settings', JSON.stringify({ shape: 'circular', nails: 220, lines: 3000, diameter_cm: 60 }));
let pattern = await (await fetch(API, {
method: 'POST',
headers: { ...auth, 'Idempotency-Key': 'order-1042' },
body: form,
})).json();
while (pattern.status === 'queued' || pattern.status === 'running') {
await new Promise(resolve => setTimeout(resolve, 2000));
pattern = await (await fetch(`${API}/${pattern.id}`, { headers: auth })).json();
}
console.log(pattern.results[0].sequence);
# pip install requests
import json, os, time, requests
API = "https://stringartapp.com/api/v1/patterns"
auth = {"Authorization": f"Bearer {os.environ['STRINGART_KEY']}"}
with open("photo.jpg", "rb") as photo:
pattern = requests.post(
API,
headers={**auth, "Idempotency-Key": "order-1042"},
files={"image": photo},
data={"settings": json.dumps({"shape": "circular", "nails": 220, "lines": 3000, "diameter_cm": 60})},
).json()
while pattern["status"] in ("queued", "running"):
time.sleep(2)
pattern = requests.get(f"{API}/{pattern['id']}", headers=auth).json()
print(pattern["results"][0]["sequence"])
You can also send JSON with a public image_url (or image_base64) instead of a file:
curl https://stringartapp.com/api/v1/patterns \
-H "Authorization: Bearer $STRINGART_KEY" \
-H "Content-Type: application/json" \
-d '{"image_url":"https://example.com/photo.jpg","shape":"rectangular","width_cm":40,"height_cm":50,"lines":4000}'
Idempotency-Key is optional but recommended: sending the same key again returns the first pattern instead of making (and charging for) a new one.
The same options as the app. Anything you leave out uses the app's default. Unknown settings are refused, so a typo never silently changes a pattern.
| Setting | Values | Default |
|---|---|---|
shape | circular or rectangular | circular |
color | black, white (on a dark board), color, or black_white (black and white thread together on the board you choose) | black |
board | black_white only: white or black board | white |
nails | Whole number, 120 to 350 | 220 |
lines | Whole number, 1,000 to 12,000 | 3000 (2000 for white, 12000 for black_white: it stops by itself once more thread no longer helps) |
thread_thickness_mm | 0.10 to 2.00, in 0.01 steps | 0.2 |
diameter_cm | Circular only. 20 to 200, in 0.1 steps | 60 |
width_cm, height_cm | Rectangular only. 20 to 200, in 0.1 steps | 60 × 60 |
nail_diameter_mm | Black and white thread. 0.5 to 6, in 0.1 steps. Nails plus thread must fit between neighbouring nails. | 2 |
algorithm | Black and white thread: all returns all four algorithms, A to D (the app's four tabs, A is the newest). A, B, C or D returns only that one, sooner. Either way it is one pattern. | all |
remove_background | Black and white thread: true puts the main subject on a plain backdrop, as the app does; false keeps the photo's background | true |
nail_layout | Rectangular black or white: uniform or ruler-v2 | uniform |
palette | Color only: cmyk, rgb or custom | cmyk |
custom_colors | With palette: "custom": 2 to 6 colors like "#1A2B3C" | None |
crop | {"x","y","width","height"} as fractions of the photo (0 to 1). Without it the photo is centre-cropped to the frame. | None |
webhook_url | Public https:// address to call when the pattern is done (Growth and Business) | None |
Photos: JPEG, PNG, WebP, GIF or HEIC, up to 12 MB and 8 million pixels. Photos are deleted as soon as the pattern is made. Patterns and files are kept for 7 days.
A finished pattern has one entry in results per algorithm, plus file links: four for a black or white pattern, round or rectangular (one if you named an algorithm), and one for color. Nails are numbered from 1, as on the printed template.
{
"id": "pat_8fK2...",
"object": "pattern",
"status": "succeeded", // queued, running, succeeded or failed
"progress": 100,
"billed_as": "plan", // plan, overage, pack or sandbox
"settings": { "shape": "circular", "color": "black", "algorithm": "all", "nails": 220, ... },
"results": [
{
"algorithm": "A",
"nails": 220,
"lines": 3000,
"sequence": [1, 97, 12, ...], // lines + 1 nail numbers
"wraps": ["cw", "ccw", ...], // circular black: which way to wrap each nail
"thread_length_m": 1843.6,
"background_removed": true, // circular black: the subject was found and put on a plain backdrop
"nail_positions_mm": [[300, 0], ...] // mm from the frame centre, x right, y down
},
{ "algorithm": "B", ... }, { "algorithm": "C", ... }, { "algorithm": "D", ... }
],
"files": {
"A": { "preview_jpg": { "url": "...", "signed_url": "..." }, "sequence_pdf": { ... } },
"B": { ... }, "C": { ... }, "D": { ... },
"template_pdf": { "url": "...", "signed_url": "..." }
},
"expires_at": "2026-11-16T10:00:00Z"
}
url downloads the file with your API key. signed_url works without a key for one hour, so you can hand it to a browser. Color and black_white patterns also list palette, line_colors (one per line), strands (the sequence for each color) and color_changes; black_white patterns also give their board.
/api/v1/patternsMake a pattern/api/v1/patterns/{id}Read one pattern/api/v1/patternsRecent patterns (limit, before)/api/v1/accountYour plan and usageEvery pattern already holds what it takes to replay the build: the nail positions and the sequence. The player draws it on a canvas in your visitor's browser at the true thread width, with the thread being pulled shown in amber. It never calls the API, so it costs nothing and needs no key.
<script src="https://stringartapp.com/static/api/string-art-player-v1.js"></script>
<string-art-player id="build" controls autoplay></string-art-player>
<script>
// The pattern JSON from GET /api/v1/patterns/{id}, passed on by your server.
// Never put your API key in a web page.
document.getElementById('build').pattern = patternJson;
</script>
Or point src at a URL on your own server that returns the pattern JSON. To try it now, use our sample: src="https://stringartapp.com/static/api/sample-pattern.json". You can also download the script and host it yourself.
| Attribute | What it does | Default |
|---|---|---|
src | URL of a pattern JSON to load (or set the pattern property) | None |
algorithm | Which result to play: A, B, C or D. With more than one in the pattern, the controls show a switch. | A |
controls | Play/pause, a thread slider, the thread count and speed | Off |
autoplay, loop | Start when on screen; start over after a short pause. Without autoplay it shows the finished piece. | Off |
duration | Seconds to string the whole pattern at 1× speed | 30 |
easing | linear (steady, for following along) or showcase (a few threads first, then it fills in) | linear |
background, thread-color | Override the board and thread colors. By default the board is white, or near black for white thread. | From the pattern |
show-nails | false hides the nail dots | true |
From script: play(), pause(), seek(line), and the line, lines, speed and playing properties. Events: load, play, pause, progress (with line, from and to nail numbers, and color) and end. Style it with the CSS variables --sap-accent, --sap-bar and --sap-text, or the ::part(controls) and ::part(canvas) selectors.
On iOS or Android, draw the same thing with your own canvas (Core Graphics, SwiftUI Canvas, Android Canvas or Compose):
settings: a circle of diameter_cm, or width_cm × height_cm. Positions in nail_positions_mm are millimetres from the frame centre, with x to the right and y down.scale = 0.975 × view size ÷ frame size in mm. A nail lands at centre + position × scale.color: "white"). Set the line width to thread_thickness_mm × scale, times 0.65 for circular black, as the app draws it.i from 1 to lines, stroke one line from nail sequence[i-1] to nail sequence[i], in black, white, or line_colors[i-1] for color. Skip it when that color is null, because the thread jumps behind the board there. Use one stroke per thread so crossings get darker the way real thread does.Add webhook_url to a request and we POST to it when the pattern finishes (up to 3 tries):
{"type": "pattern.succeeded", "pattern_id": "pat_8fK2...", "created": 1762682400}
Then fetch the pattern for its results. Check the StringArt-Signature header, t=<unix time>,v1=<hex>, where v1 is HMAC-SHA256 of t + "." + body with your webhook signing secret:
const [t, v1] = header.split(',').map(part => part.split('=')[1]);
const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
const valid = crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected))
&& Math.abs(Date.now() / 1000 - Number(t)) < 300;
Errors use HTTP status codes and a JSON body like {"error": {"code": "invalid_settings", "message": "...", "field": "nails"}}.
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_settings invalid_image invalid_request | Fix the request; field names the setting. |
| 401 | invalid_key | Missing, wrong or revoked key. |
| 402 | quota_exhausted spend_cap_reached | Out of free or pack patterns, or your spending limit is reached. |
| 403 | webhooks_unavailable | Webhooks need Growth or Business. |
| 409 | idempotency_conflict | That Idempotency-Key was used for a different request. |
| 413 | invalid_image | The photo is over 12 MB. |
| 429 | rate_limited too_many_jobs | Too many new patterns a minute for your plan, more than 120 status checks and downloads a minute per key, or too many patterns running at once. Retry after a short wait. |
| 503 | unavailable | Temporary. Retry with the same Idempotency-Key. |
A pattern that fails after it was accepted has status: "failed" and an error; it is not charged.
Questions
You do, including for commercial use. Sell kits, prints or finished pieces made from paid patterns. Sandbox patterns are stamped and are only for testing.
For a black or white thread pattern, round or rectangular, four for the price of one: all four algorithms (A, B, C and D) come back, each with its own sequence, preview and step-by-step PDF, billed as one pattern.
Yes. Our free animation player replays any pattern thread by thread on your page, with a switch between algorithms, speed and a slider. It runs in the browser from the pattern you already have, so it never uses up patterns.
No. Only patterns that succeed count. A damaged photo or a failed run is refunded automatically, and a repeated Idempotency-Key never charges twice.
Photos are deleted as soon as the pattern is made. Patterns and their files are kept for 7 days, so download what you need to keep.
Yes. Set a monthly spending limit in Your API and new patterns stop once you reach it. You can also stick to packs, which never bill more than you bought.
Yes. Turn on Auto top-up in Your API and pick 5 or 10 patterns. When your pack balance falls that low, we buy another 50-pattern pack with the card you saved through Stripe and email you a note. If the card is declined or your bank asks you to confirm the payment, auto top-up turns itself off and we let you know. Turn it off any time.
Switch plans from Your API; the difference is prorated. Cancel or update your card from “Manage billing”.
Email support@stringartapp.com and we will put together an Enterprise plan.
25 sandbox patterns a month. No card needed.