Skip to content

Instantly share code, notes, and snippets.

@jaeyson
Created October 7, 2025 04:39
Show Gist options
  • Save jaeyson/d1b47c7f546f0aa78d14f717a9b1748d to your computer and use it in GitHub Desktop.
Save jaeyson/d1b47c7f546f0aa78d14f717a9b1748d to your computer and use it in GitHub Desktop.
Scrapper for Mapbox Studio for getting a custom font

Getting your custom font (once uploaded to the MapBox Studio interface), by downloading the actual pbf files. You need to fill-in your font name, username and the access token, see: https://www.mapbox.com/account/.

#!/bin/bash
# Goto: https://www.mapbox.com/studio/
# The correct font name can be found once you opened your style and click on 'Fonts' in the right-top legend.
# Under 'My Fonts' you need to click on the font name once again (!), to reveal the actual font name. Use this name below, do not make any mistake here.
FONT_NAME="Font Awesome 5 Free Solid"
# Username & access token can be found here: https://www.mapbox.com/account/
USERNAME=""
ACCESS_TOKEN=""
declare -a files
files=("0-255.pbf" "1024-1279.pbf" "10240-10495.pbf" "10496-10751.pbf" "10752-11007.pbf" "11008-11263.pbf" "11264-11519.pbf" "11520-11775.pbf" "11776-12031.pbf" "12032-12287.pbf" "12288-12543.pbf" "12544-12799.pbf" "1280-1535.pbf" "12800-13055.pbf" "13056-13311.pbf" "13312-13567.pbf" "13568-13823.pbf" "13824-14079.pbf" "14080-14335.pbf" "14336-14591.pbf" "14592-14847.pbf" "14848-15103.pbf" "15104-15359.pbf" "1536-1791.pbf" "15360-15615.pbf" "15616-15871.pbf" "15872-16127.pbf" "16128-16383.pbf" "16384-16639.pbf" "16640-16895.pbf" "16896-17151.pbf" "17152-17407.pbf" "17408-17663.pbf" "17664-17919.pbf" "1792-2047.pbf" "17920-18175.pbf" "18176-18431.pbf" "18432-18687.pbf" "18688-18943.pbf" "18944-19199.pbf" "19200-19455.pbf" "19456-19711.pbf" "19712-19967.pbf" "19968-20223.pbf" "20224-20479.pbf" "2048-2303.pbf" "20480-20735.pbf" "20736-20991.pbf" "20992-21247.pbf" "21248-21503.pbf" "21504-21759.pbf" "21760-22015.pbf" "22016-22271.pbf" "22272-22527.pbf" "22528-22783.pbf" "22784-23039.pbf" "2304-2559.pbf" "23040-23295.pbf" "23296-23551.pbf" "23552-23807.pbf" "23808-24063.pbf" "24064-24319.pbf" "24320-24575.pbf" "24576-24831.pbf" "24832-25087.pbf" "25088-25343.pbf" "25344-25599.pbf" "256-511.pbf" "2560-2815.pbf" "25600-25855.pbf" "25856-26111.pbf" "26112-26367.pbf" "26368-26623.pbf" "26624-26879.pbf" "26880-27135.pbf" "27136-27391.pbf" "27392-27647.pbf" "27648-27903.pbf" "27904-28159.pbf" "2816-3071.pbf" "28160-28415.pbf" "28416-28671.pbf" "28672-28927.pbf" "28928-29183.pbf" "29184-29439.pbf" "29440-29695.pbf" "29696-29951.pbf" "29952-30207.pbf" "30208-30463.pbf" "30464-30719.pbf" "3072-3327.pbf" "30720-30975.pbf" "30976-31231.pbf" "31232-31487.pbf" "31488-31743.pbf" "31744-31999.pbf" "32000-32255.pbf" "32256-32511.pbf" "32512-32767.pbf" "32768-33023.pbf" "33024-33279.pbf" "3328-3583.pbf" "33280-33535.pbf" "33536-33791.pbf" "33792-34047.pbf" "34048-34303.pbf" "34304-34559.pbf" "34560-34815.pbf" "34816-35071.pbf" "35072-35327.pbf" "35328-35583.pbf" "35584-35839.pbf" "3584-3839.pbf" "35840-36095.pbf" "36096-36351.pbf" "36352-36607.pbf" "36608-36863.pbf" "36864-37119.pbf" "37120-37375.pbf" "37376-37631.pbf" "37632-37887.pbf" "37888-38143.pbf" "38144-38399.pbf" "3840-4095.pbf" "38400-38655.pbf" "38656-38911.pbf" "38912-39167.pbf" "39168-39423.pbf" "39424-39679.pbf" "39680-39935.pbf" "39936-40191.pbf" "40192-40447.pbf" "40448-40703.pbf" "40704-40959.pbf" "4096-4351.pbf" "40960-41215.pbf" "41216-41471.pbf" "41472-41727.pbf" "41728-41983.pbf" "41984-42239.pbf" "42240-42495.pbf" "42496-42751.pbf" "42752-43007.pbf" "43008-43263.pbf" "43264-43519.pbf" "4352-4607.pbf" "43520-43775.pbf" "43776-44031.pbf" "44032-44287.pbf" "44288-44543.pbf" "44544-44799.pbf" "44800-45055.pbf" "45056-45311.pbf" "45312-45567.pbf" "45568-45823.pbf" "45824-46079.pbf" "4608-4863.pbf" "46080-46335.pbf" "46336-46591.pbf" "46592-46847.pbf" "46848-47103.pbf" "47104-47359.pbf" "47360-47615.pbf" "47616-47871.pbf" "47872-48127.pbf" "48128-48383.pbf" "48384-48639.pbf" "4864-5119.pbf" "48640-48895.pbf" "48896-49151.pbf" "49152-49407.pbf" "49408-49663.pbf" "49664-49919.pbf" "49920-50175.pbf" "50176-50431.pbf" "50432-50687.pbf" "50688-50943.pbf" "50944-51199.pbf" "512-767.pbf" "5120-5375.pbf" "51200-51455.pbf" "51456-51711.pbf" "51712-51967.pbf" "51968-52223.pbf" "52224-52479.pbf" "52480-52735.pbf" "52736-52991.pbf" "52992-53247.pbf" "53248-53503.pbf" "53504-53759.pbf" "5376-5631.pbf" "53760-54015.pbf" "54016-54271.pbf" "54272-54527.pbf" "54528-54783.pbf" "54784-55039.pbf" "55040-55295.pbf" "55296-55551.pbf" "55552-55807.pbf" "55808-56063.pbf" "56064-56319.pbf" "5632-5887.pbf" "56320-56575.pbf" "56576-56831.pbf" "56832-57087.pbf" "57088-57343.pbf" "57344-57599.pbf" "57600-57855.pbf" "57856-58111.pbf" "58112-58367.pbf" "58368-58623.pbf" "58624-58879.pbf" "5888-6143.pbf" "58880-59135.pbf" "59136-59391.pbf" "59392-59647.pbf" "59648-59903.pbf" "59904-60159.pbf" "60160-60415.pbf" "60416-60671.pbf" "60672-60927.pbf" "60928-61183.pbf" "61184-61439.pbf" "6144-6399.pbf" "61440-61695.pbf" "61696-61951.pbf" "61952-62207.pbf" "62208-62463.pbf" "62464-62719.pbf" "62720-62975.pbf" "62976-63231.pbf" "63232-63487.pbf" "63488-63743.pbf" "63744-63999.pbf" "6400-6655.pbf" "64000-64255.pbf" "64256-64511.pbf" "64512-64767.pbf" "64768-65023.pbf" "65024-65279.pbf" "65280-65535.pbf" "6656-6911.pbf" "6912-7167.pbf" "7168-7423.pbf" "7424-7679.pbf" "768-1023.pbf" "7680-7935.pbf" "7936-8191.pbf" "8192-8447.pbf" "8448-8703.pbf" "8704-8959.pbf" "8960-9215.pbf" "9216-9471.pbf" "9472-9727.pbf" "9728-9983.pbf" "9984-10239.pbf")
mkdir -p "${FONT_NAME}"
echo "Created font directory."
for filename in "${files[@]}"
do
get_url="https://api.mapbox.com/fonts/v1/${USERNAME}/${FONT_NAME}/${filename}?access_token=${ACCESS_TOKEN}"
echo "Downloading ${filename} ..."
wget -q -O- --header\="Accept-Encoding: gzip" "${get_url}" | gunzip > "${FONT_NAME}/${filename}"
done
echo "DONE!"
echo "Files can be found in the download directory: ./${FONT_NAME}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment