Import a Google Fonts family
curl --request POST \
--url http://localhost:3000/api/v1/fonts/google \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"family": "<string>",
"fields": {},
"collections": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"tags": [
"<string>"
]
}
'import requests
url = "http://localhost:3000/api/v1/fonts/google"
payload = {
"family": "<string>",
"fields": {},
"collections": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"tags": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
family: '<string>',
fields: {},
collections: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
tags: ['<string>']
})
};
fetch('http://localhost:3000/api/v1/fonts/google', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/fonts/google",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'family' => '<string>',
'fields' => [
],
'collections' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/api/v1/fonts/google"
payload := strings.NewReader("{\n \"family\": \"<string>\",\n \"fields\": {},\n \"collections\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3000/api/v1/fonts/google")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"family\": \"<string>\",\n \"fields\": {},\n \"collections\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/fonts/google")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"family\": \"<string>\",\n \"fields\": {},\n \"collections\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"family": "<string>",
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sha256": "<string>",
"filename": "<string>",
"mime": "<string>",
"size": 0,
"width": 0,
"height": 0,
"probe": {},
"metadata": {
"title": "<string>",
"description": "<string>",
"keywords": [
"<string>"
],
"creator": "<string>",
"copyright": "<string>",
"capturedAt": "<string>",
"camera": "<string>",
"lens": "<string>",
"gps": {
"lat": 123,
"lon": 123
}
},
"tags": [
"<string>"
],
"fields": {},
"inherited": {},
"status": "draft",
"state": "draft",
"deletedAt": "2023-11-07T05:31:56Z",
"stackId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 0,
"current": true,
"proposedBy": "<string>",
"reviewNote": "<string>",
"proposedTags": [
"<string>"
],
"rights": {
"license": "<string>",
"territories": [
"<string>"
],
"channels": [
"<string>"
],
"embargo": "2023-12-25",
"expires": "2023-12-25",
"modelRelease": "released"
},
"origin": "shot",
"parentAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"generator": "<string>",
"prompt": "<string>",
"c2pa": {
"manifests": 0,
"generator": "<string>",
"title": "<string>",
"signedBy": "<string>",
"actions": [
"<string>"
],
"digitalSourceType": "<string>",
"softwareAgent": "<string>",
"ingredients": 0
},
"supersededBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"private": true,
"collections": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"detail": "<unknown>"
}
}API Reference
Import a Google Fonts family
One asset per style the family has (up to 9 weights, roman and italic), as whole TTF files. Fetched once and served from /a/ after, so nobody’s browser calls Google. Styles already here dedupe.
Scope: propose.
POST
/
api
/
v1
/
fonts
/
google
Import a Google Fonts family
curl --request POST \
--url http://localhost:3000/api/v1/fonts/google \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"family": "<string>",
"fields": {},
"collections": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"tags": [
"<string>"
]
}
'import requests
url = "http://localhost:3000/api/v1/fonts/google"
payload = {
"family": "<string>",
"fields": {},
"collections": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"tags": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
family: '<string>',
fields: {},
collections: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
tags: ['<string>']
})
};
fetch('http://localhost:3000/api/v1/fonts/google', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/fonts/google",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'family' => '<string>',
'fields' => [
],
'collections' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/api/v1/fonts/google"
payload := strings.NewReader("{\n \"family\": \"<string>\",\n \"fields\": {},\n \"collections\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3000/api/v1/fonts/google")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"family\": \"<string>\",\n \"fields\": {},\n \"collections\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/fonts/google")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"family\": \"<string>\",\n \"fields\": {},\n \"collections\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"family": "<string>",
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sha256": "<string>",
"filename": "<string>",
"mime": "<string>",
"size": 0,
"width": 0,
"height": 0,
"probe": {},
"metadata": {
"title": "<string>",
"description": "<string>",
"keywords": [
"<string>"
],
"creator": "<string>",
"copyright": "<string>",
"capturedAt": "<string>",
"camera": "<string>",
"lens": "<string>",
"gps": {
"lat": 123,
"lon": 123
}
},
"tags": [
"<string>"
],
"fields": {},
"inherited": {},
"status": "draft",
"state": "draft",
"deletedAt": "2023-11-07T05:31:56Z",
"stackId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 0,
"current": true,
"proposedBy": "<string>",
"reviewNote": "<string>",
"proposedTags": [
"<string>"
],
"rights": {
"license": "<string>",
"territories": [
"<string>"
],
"channels": [
"<string>"
],
"embargo": "2023-12-25",
"expires": "2023-12-25",
"modelRelease": "released"
},
"origin": "shot",
"parentAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"generator": "<string>",
"prompt": "<string>",
"c2pa": {
"manifests": 0,
"generator": "<string>",
"title": "<string>",
"signedBy": "<string>",
"actions": [
"<string>"
],
"digitalSourceType": "<string>",
"softwareAgent": "<string>",
"ingredients": 0
},
"supersededBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"private": true,
"collections": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"detail": "<unknown>"
}
}Authorizations
bearersession
An API key: ab_...
Body
application/json
As Google Fonts names it
Pattern:
^[A-Za-z0-9][A-Za-z0-9 ]{0,79}$Custom field values, keyed by field key
Show child attributes
Show child attributes
Maximum array length:
50Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Maximum array length:
100Maximum string length:
64