Scrub API
POST/v1/tools/draw_chartpriced

Draw a chart

A table drawn as an animated chart (a line or bars, a graph) in a brand's colours and font, the line that matters drawn through its points and the answer settling on screen with what it says. A clip, transparent to lay over a video or on a colour, and a picture of the settled chart.

Takes table_file (file). Give exactly one of: table_file; or table_text. Returns clip (the chart drawn and settling, at the aspect ratio's size and 30 frames a second. With no background, a WebM whose background is transparent, to lie over a video; with one, an MP4), picture (the settled chart as a PNG, transparent where the clip is).

$0.10 a chart.

Afterwards, change chart, says, note, title, answer, across, values, main, aspect_ratio, seconds, back, text, accent, gradient_from, gradient_to or font with adjust; quote_adjustment prices the change.

Fields

FieldTypeDefaultWhat it is
table_filestringNoneA file_id from create_upload, accepting application/vnd.scrub.table+json, text/csv, text/tab-separated-values, application/json, text/plain, up to 20 MB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. Without one, read_fields (Read documents into a table) makes one, or study_videos (Study reference videos) makes one: run it first and pass its job_id here.
table_textstringNoneA table typed or pasted, one row a line, values separated by commas or tabs, the first line the column names.
chartone oflineA line through the points, for a change from one row to the next; or bars, for comparing rows side by side.
linebars
saysstringThe words at the answer, the one thing the chart shows, such as "Mesh independent". Left empty, nothing is written there.
notestringA line under what it says, smaller, such as "finer cells stop changing the answer".
titlestringA title over the chart. Left empty, the chart has none, to sit under a title the video already has.
answerstringThe row the chart settles on, by its name in the column that runs along the bottom. Left empty, the last row.
acrossstringThe column whose values run along the bottom, by name. Left empty, the table's first column of words.
valuesstringThe columns of numbers to draw, by name, comma separated, at most four. Left empty, every column of numbers.
mainstringOf the columns drawn, the one in the brand's colours with the answer on it, by name; the others are drawn quiet. Left empty, the first.
aspect_ratioone of9:16The aspect ratio it is drawn in, width to height. 9:16 fills an upright video; 16:9 is wide, or a band across an upright one.
9:161:14:516:9
secondsnumber6How long the clip is. The line is drawn and the answer settles in the first part; the rest holds the settled chart.
backstringnullThe colour behind the chart. Left empty, none, so the clip is transparent and lies over a video.
textstring#1a1a1cThe colour of the words and the points' rings; the axes and the quiet lines are mixed from it.
accentstring#1d4fd8The colour of the line that matters, the answer and what it says. What it says is written in the text colour where the accent would not read against the background.
gradient_fromstringnullA colour the line that matters starts in, passing through the accent. Left empty, it starts in the accent.
gradient_tostringnullA colour the line that matters ends in, from the accent. Left empty, it ends in the accent.
fontone ofInter TightThe font every word on the chart is set in. Inter Tight: Tight and even; every caption style's face. Inter: The plainest, most legible sans; explainers and data. Manrope: Calm, geometric and modern. Hanken Grotesk: Soft, open grotesque; friendly captions that stay easy to read. Archivo: Sturdy grotesque with real weight; news and how-tos. Montserrat: The face most short-form captions are set in. Poppins: Round geometric sans; friendly brands and lifestyle. Figtree: Clean and warm, a little softer than Inter. Bricolage Grotesque: Quirky editorial sans. Rubik: Slightly rounded corners; playful but tidy. Bebas Neue: Tall capitals; titles, numbers and sport. Anton: Heavy, narrow capitals; the loudest hook text. Oswald: Condensed, with weights; lists and labels. League Gothic: Classic condensed gothic; posters and film titles. Fraunces: Soft, old-style serif; warm stories. Playfair Display: High-contrast serif; elegant titles. Instrument Serif: Narrow editorial serif. DM Serif Display: Bold display serif; quotes and headlines. PT Serif: Classic text serif with italics; reports, history and quotes. Caveat: Quick handwriting; notes and asides. Bangers: Comic-book capitals; reactions and gaming. Luckiest Guy: Fat cartoon capitals; kids, gaming and hooks. JetBrains Mono: Monospace; code, terminals and numbers that line up.
Inter TightInterManropeHanken GroteskArchivoMontserratPoppinsFigtreeBricolage GrotesqueRubikBebas NeueAntonOswaldLeague GothicFrauncesPlayfair DisplayInstrument SerifDM Serif DisplayPT SerifCaveatBangersLuckiest GuyJetBrains Mono
brand_kitstringNoneA Brand Kit's id (kit_…) from list_brand_kits: its look and settings fill what this call leaves out, and what the call gives wins. Read once when the job starts.

Call it

Request

curl -X POST https://app.scrub.app/v1/tools/draw_chart \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Answer

{
  "ok": true,
  "result": {
    "job_id": "job_…",
    "status": "running",
    "price_usd": "$…"
  }
}

It starts at once and answers running. Ask job_status with the job_id for its result. quote gives its price first, free.

Every call can also answer an error: what comes back. Try it with your key from Account.