Skip to content

Instantly share code, notes, and snippets.

@jimbrig
Last active November 7, 2024 23:04
Show Gist options
  • Save jimbrig/31baad0fb8c027b063cfd0c32723d16d to your computer and use it in GitHub Desktop.
Save jimbrig/31baad0fb8c027b063cfd0c32723d16d to your computer and use it in GitHub Desktop.
Brandfetch OpenAPI
{
"openapi": "3.1.0",
"info": {
"title": "BrandFetch API",
"description": "API for retrieving brand information using domain or ID.",
"version": "1.0.0",
"termsOfService": "https://brandfetch.com/terms",
"license": {
"name": "MIT",
"url": "https://choosealicense.com/licenses/mit/"
},
"contact": {
"name": "Brandfetch Developers",
"url": "https://brandfetch.com/developers"
}
},
"servers": [
{
"url": "https://api.brandfetch.io/{version}",
"variables": {
"version": {
"description": "API Version",
"default": "v1",
"enum": [
"v1"
]
}
}
}
],
"tags": [
{
"name": "Brand",
"description": "Brands"
}
],
"security": [
{
"bearerAuth": []
}
],
"paths": {
"/brands/{domainOrId}": {
"get": {
"summary": "Retrieve brand information",
"description": "Retrieves detailed information about a brand using the provided domain or ID.",
"operationId": "getBrandInfo",
"tags": [
"Brand"
],
"parameters": [
{
"$ref": "#/components/parameters/domainOrId"
}
],
"responses": {
"200": {
"$ref": "#/components/responses/BrandInfoResponse"
},
"400": {
"$ref": "#/components/responses/BadRequestError"
},
"401": {
"$ref": "#/components/responses/UnauthorizedError"
},
"404": {
"$ref": "#/components/responses/NotFoundError"
},
"429": {
"$ref": "#/components/responses/RateLimitError"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"bearerAuth": []
}
]
}
}
},
"components": {
"parameters": {
"domainOrId": {
"name": "domainOrId",
"in": "path",
"required": true,
"description": "The domain or ID of the brand to retrieve information for.",
"schema": {
"type": "string"
}
}
},
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "API Key",
"description": "Bearer Authentication via API Key"
}
},
"schemas": {
"Brand": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The unique identifier of the brand."
},
"name": {
"type": [
"string",
"null"
],
"description": "The name of the brand."
},
"domain": {
"type": "string",
"description": "The domain of the brand."
},
"claimed": {
"type": "boolean",
"description": "Indicates if the brand is claimed."
},
"description": {
"type": [
"string",
"null"
],
"description": "A short description of the brand."
},
"longDescription": {
"type": [
"string",
"null"
],
"description": "A detailed description of the brand."
},
"links": {
"type": "array",
"description": "Social Media links for the brand.",
"items": {
"$ref": "#/components/schemas/Link"
}
},
"logos": {
"type": "array",
"description": "Logos, Symbols, and Icons for the brand.",
"items": {
"$ref": "#/components/schemas/Logo"
}
},
"colors": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Color"
}
},
"fonts": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Font"
}
},
"images": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Image"
}
},
"qualityScore": {
"type": "number",
"description": "Score between 0-1 which indicates the quality of the data for the given brand. Useful when you don't want to show lower quality brands to your users.\nLower 3rd is poor quality, middle 3rd is OK quality, upper 3rd is high quality. Lower scores indicate that a brand is less likely to be \"real\". For example, where google.com will score high, my-random-blog.com will score between 0.3-0.4. The score factors in things like data-recency, whether the brand has been claimed, if it has been manually verified by our team, the brand's domain ranking on the web, as well as other factors.\nDon't rely on a fixed score for any given brand. The way we calculate this score may change over time as we add new factors, or tweak the weights of existing ones such that a score for a given brand may change. However, they will remain aligned such that scores divide quality into thirds: low, medium, high."
},
"company": {
"$ref": "#/components/schemas/Company"
},
"isNsfw": {
"type": "boolean",
"description": "Indicates if the brand is NSFW (Not Safe For Work)."
},
"urn": {
"type": "string",
"description": "The unique resource name of the brand."
}
}
},
"Link": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the social media platform.",
"enum": [
"twitter",
"facebook",
"instagram",
"github",
"youtube",
"linkedin",
"crunchbase"
]
},
"url": {
"type": "string",
"description": "The URL of the social media profile.",
"format": "url"
}
}
},
"Logo": {
"type": "object",
"properties": {
"theme": {
"type": [
"string",
"null"
],
"description": "The theme of the logo (e.g., light or dark).",
"enum": [
"dark",
"light"
]
},
"formats": {
"type": "array",
"description": "List of format objects containing files in various formats.",
"items": {
"$ref": "#/components/schemas/LogoFormat"
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/LogoTag"
}
},
"type": {
"type": "string",
"description": "The type of logo (e.g., logo, symbol, icon).",
"enum": [
"icon",
"logo",
"symbol",
"other"
]
}
}
},
"LogoFormat": {
"type": "object",
"description": "Format for the logo",
"properties": {
"src": {
"type": "string",
"description": "The source URL of the logo."
},
"format": {
"type": "string",
"description": "The format of the logo (e.g., svg, png).",
"enum": [
"svg",
"webp",
"png",
"jpeg"
]
},
"height": {
"type": [
"integer",
"null"
],
"description": "The height of the logo in pixels."
},
"width": {
"type": [
"integer",
"null"
],
"description": "The width of the logo in pixels."
},
"size": {
"type": "integer",
"description": "The size of the logo in bytes."
},
"background": {
"type": [
"string",
"null"
],
"description": "The background color of the logo (e.g., transparent).",
"enum": [
"transparent"
]
}
}
},
"LogoTag": {
"type": "string",
"enum": [
"photographic",
"portrait"
],
"description": "photographic: The asset image is photographic in nature, indicating it has photographic qualities rather than a typical brand logotype;\nportrait: The asset image is a portrait or portrait-like, often used when a brand features a self-portrait as a logo."
},
"Color": {
"type": "object",
"description": "Accent, dark, light, and palette colors for the brand.",
"properties": {
"hex": {
"type": "string",
"description": "The HEX code of the color."
},
"type": {
"type": "string",
"description": "The type of color (e.g., accent, brand).",
"enum": [
"accent",
"dark",
"light",
"brand"
]
},
"brightness": {
"type": "number",
"description": "Color brightness. Calculated based on the standard formula 0.2126R + 0.7152G + 0.0722*B."
}
}
},
"Font": {
"type": "object",
"description": "Title and body fonts for the brand.",
"properties": {
"name": {
"type": [
"string",
"null"
],
"description": "Font family"
},
"type": {
"type": "string",
"description": "The usage type of the font (e.g., title, body).",
"enum": [
"title",
"body"
]
},
"origin": {
"type": "string",
"description": "The origin of the font (e.g., google).",
"enum": [
"google",
"custom",
"system"
]
},
"originId": {
"type": [
"string",
"null"
],
"description": "The identifier of the font in the origin."
},
"weights": {
"type": "array",
"items": {
"type": "object"
}
}
}
},
"Image": {
"type": "object",
"description": "Banner and other images of the brand.",
"properties": {
"formats": {
"type": "array",
"items": {
"$ref": "#/components/schemas/LogoFormat"
}
},
"tags": {
"type": "array",
"items": {
"type": "object"
}
},
"type": {
"type": "string",
"description": "The type of image (e.g., banner).",
"enum": [
"banner",
"other"
]
}
}
},
"Company": {
"type": "object",
"description": "Company object with firmographic data related to the brand.",
"properties": {
"employees": {
"type": [
"integer",
"null"
],
"description": "1 employee, 2-10 employees, 11-50 employees, 51-200 employees, 201-500 employees, 501-1,000 employees, 1,001-5,000 employees, 5,001-10,000 employees, 10,001+ employees",
"enum": [
1,
2,
11,
51,
201,
501,
1001,
5001,
10001
]
},
"foundedYear": {
"type": [
"integer",
"null"
],
"description": "The year the company was founded."
},
"industries": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Industry"
}
},
"kind": {
"type": [
"string",
"null"
],
"description": "The kind of company (e.g., PRIVATELY_HELD).",
"enum": [
"EDUCATIONAL",
"GOVERNMENT_AGENCY",
"NON_PROFIT",
"PARTNERSHIP",
"PRIVATELY_HELD",
"PUBLIC_COMPANY",
"SELF_EMPLOYED",
"SELF_OWNED"
]
},
"location": {
"$ref": "#/components/schemas/Location"
}
}
},
"Industry": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The industry ID."
},
"score": {
"type": "number",
"description": "The relevance score for the industry."
},
"slug": {
"type": "string",
"description": "The slug of the industry."
},
"name": {
"type": "string",
"description": "The name of the industry."
},
"emoji": {
"type": "string",
"description": "An emoji representing the industry."
},
"parent": {
"type": [
"object",
"null"
],
"$ref": "#/components/schemas/IndustryParent"
}
}
},
"IndustryParent": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"slug": {
"type": "string"
},
"name": {
"type": "string"
},
"emoji": {
"type": "string"
}
}
},
"Location": {
"type": "object",
"properties": {
"city": {
"type": "string"
},
"country": {
"type": "string"
},
"countryCode": {
"type": "string"
},
"region": {
"type": "string"
},
"state": {
"type": "string"
},
"subregion": {
"type": "string"
}
}
},
"ErrorResponse": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "A message describing the error."
}
}
}
},
"responses": {
"BrandInfoResponse": {
"description": "A successful response containing brand information.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Brand"
}
}
}
},
"BadRequestError": {
"description": "Bad request due to invalid parameters.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
}
},
"UnauthorizedError": {
"description": "Unauthorized, missing or invalid API token.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
}
},
"NotFoundError": {
"description": "Brand not found.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
}
},
"RateLimitError": {
"description": "Too many requests, rate limit exceeded.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
},
"Retry-After": {
"$ref": "#/components/headers/Retry-After"
}
}
},
"InternalServerError": {
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
},
"headers": {
"X-RateLimit-Limit": {
"description": "The number of allowed requests per time period.",
"schema": {
"type": "integer"
}
},
"X-RateLimit-Remaining": {
"description": "The number of remaining requests in the current time period.",
"schema": {
"type": "integer"
}
},
"X-RateLimit-Reset": {
"description": "The time at which the rate limit resets in UTC epoch seconds.",
"schema": {
"type": "integer"
}
},
"Retry-After": {
"description": "The time in seconds after which the client can retry the request.",
"schema": {
"type": "integer"
}
}
}
}
}
openapi: 3.1.0
info:
title: BrandFetch API
description: API for retrieving brand information using domain or ID.
version: 1.0.0
termsOfService: https://brandfetch.com/terms
license:
name: MIT
url: https://choosealicense.com/licenses/mit/
contact:
name: Brandfetch Developers
url: https://brandfetch.com/developers
servers:
- url: https://api.brandfetch.io/{version}
variables:
version:
description: API Version
default: v1
enum:
- v1
tags:
- name: Brand
description: Brands
security:
- bearerAuth: []
paths:
/brands/{domainOrId}:
get:
summary: Retrieve brand information
description: Retrieves detailed information about a brand using the provided domain or ID.
operationId: getBrandInfo
tags: ['Brand']
parameters:
- $ref: '#/components/parameters/domainOrId'
responses:
'200':
$ref: '#/components/responses/BrandInfoResponse'
'400':
$ref: '#/components/responses/BadRequestError'
'401':
$ref: '#/components/responses/UnauthorizedError'
'404':
$ref: '#/components/responses/NotFoundError'
'429':
$ref: '#/components/responses/RateLimitError'
'500':
$ref: '#/components/responses/InternalServerError'
security:
- bearerAuth: []
components:
parameters:
domainOrId:
name: domainOrId
in: path
required: true
description: The domain or ID of the brand to retrieve information for.
schema:
type: string
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: API Key
description: Bearer Authentication via API Key
schemas:
Brand:
type: object
properties:
id:
type: string
description: The unique identifier of the brand.
name:
type: ['string', 'null']
description: The name of the brand.
domain:
type: string
description: The domain of the brand.
claimed:
type: boolean
description: Indicates if the brand is claimed.
description:
type: ['string', 'null']
description: A short description of the brand.
longDescription:
type: ['string', 'null']
description: A detailed description of the brand.
links:
type: array
description: Social Media links for the brand.
items:
$ref: '#/components/schemas/Link'
logos:
type: array
description: Logos, Symbols, and Icons for the brand.
items:
$ref: '#/components/schemas/Logo'
colors:
type: array
items:
$ref: '#/components/schemas/Color'
fonts:
type: array
items:
$ref: '#/components/schemas/Font'
images:
type: array
items:
$ref: '#/components/schemas/Image'
qualityScore:
type: number
description: >-
Score between 0-1 which indicates the quality of the data for the given brand. Useful when you don't want to show lower quality brands to your users.
Lower 3rd is poor quality, middle 3rd is OK quality, upper 3rd is high quality. Lower scores indicate that a brand is less likely to be "real". For example, where google.com will score high, my-random-blog.com will score between 0.3-0.4. The score factors in things like data-recency, whether the brand has been claimed, if it has been manually verified by our team, the brand's domain ranking on the web, as well as other factors.
Don't rely on a fixed score for any given brand. The way we calculate this score may change over time as we add new factors, or tweak the weights of existing ones such that a score for a given brand may change. However, they will remain aligned such that scores divide quality into thirds: low, medium, high.
company:
$ref: '#/components/schemas/Company'
isNsfw:
type: boolean
description: Indicates if the brand is NSFW (Not Safe For Work).
urn:
type: string
description: The unique resource name of the brand.
Link:
type: object
properties:
name:
type: string
description: The name of the social media platform.
enum:
- twitter
- facebook
- instagram
- github
- youtube
- linkedin
- crunchbase
url:
type: string
description: The URL of the social media profile.
format: url
Logo:
type: object
properties:
theme:
type: ['string', 'null']
description: The theme of the logo (e.g., light or dark).
enum:
- dark
- light
formats:
type: array
description: List of format objects containing files in various formats.
items:
$ref: '#/components/schemas/LogoFormat'
tags:
type: array
items:
$ref: '#/components/schemas/LogoTag'
type:
type: string
description: The type of logo (e.g., logo, symbol, icon).
enum:
- icon
- logo
- symbol
- other
LogoFormat:
type: object
description: Format for the logo
properties:
src:
type: string
description: The source URL of the logo.
format:
type: string
description: The format of the logo (e.g., svg, png).
enum:
- svg
- webp
- png
- jpeg
height:
type: ['integer', 'null']
description: The height of the logo in pixels.
width:
type: ['integer', 'null']
description: The width of the logo in pixels.
size:
type: integer
description: The size of the logo in bytes.
background:
type: ['string', 'null']
description: The background color of the logo (e.g., transparent).
enum:
- transparent
LogoTag:
type: string
enum:
- photographic
- portrait
description: >-
photographic: The asset image is photographic in nature, indicating it has photographic qualities rather than a typical brand logotype;
portrait: The asset image is a portrait or portrait-like, often used when a brand features a self-portrait as a logo.
Color:
type: object
description: Accent, dark, light, and palette colors for the brand.
properties:
hex:
type: string
description: The HEX code of the color.
type:
type: string
description: The type of color (e.g., accent, brand).
enum:
- accent
- dark
- light
- brand
brightness:
type: number
description: >-
Color brightness. Calculated based on the standard formula 0.2126R + 0.7152G + 0.0722*B.
Font:
type: object
description:
Title and body fonts for the brand.
properties:
name:
type: ['string', 'null']
description: Font family
type:
type: string
description: The usage type of the font (e.g., title, body).
enum:
- title
- body
origin:
type: string
description: The origin of the font (e.g., google).
enum:
- google
- custom
- system
originId:
type: ['string', 'null']
description: The identifier of the font in the origin.
weights:
type: array
items:
type: object
Image:
type: object
description: Banner and other images of the brand.
properties:
formats:
type: array
items:
$ref: '#/components/schemas/LogoFormat'
tags:
type: array
items:
type: object
type:
type: string
description: The type of image (e.g., banner).
enum:
- banner
- other
Company:
type: object
description: Company object with firmographic data related to the brand.
properties:
employees:
type: ['integer', 'null']
description: >-
1 employee, 2-10 employees, 11-50 employees, 51-200 employees, 201-500 employees, 501-1,000 employees, 1,001-5,000 employees, 5,001-10,000 employees, 10,001+ employees
enum:
- 1
- 2
- 11
- 51
- 201
- 501
- 1001
- 5001
- 10001
foundedYear:
type: ['integer', 'null']
description: The year the company was founded.
industries:
type: array
items:
$ref: '#/components/schemas/Industry'
kind:
type: ['string', 'null']
description: The kind of company (e.g., PRIVATELY_HELD).
enum:
- EDUCATIONAL
- GOVERNMENT_AGENCY
- NON_PROFIT
- PARTNERSHIP
- PRIVATELY_HELD
- PUBLIC_COMPANY
- SELF_EMPLOYED
- SELF_OWNED
location:
$ref: '#/components/schemas/Location'
Industry:
type: object
properties:
id:
type: string
description: The industry ID.
score:
type: number
description: The relevance score for the industry.
slug:
type: string
description: The slug of the industry.
name:
type: string
description: The name of the industry.
emoji:
type: string
description: An emoji representing the industry.
parent:
type: ['object', 'null']
$ref: '#/components/schemas/IndustryParent'
IndustryParent:
type: object
properties:
id:
type: string
slug:
type: string
name:
type: string
emoji:
type: string
Location:
type: object
properties:
city:
type: string
country:
type: string
countryCode:
type: string
region:
type: string
state:
type: string
subregion:
type: string
ErrorResponse:
type: object
properties:
message:
type: string
description: A message describing the error.
responses:
BrandInfoResponse:
description: A successful response containing brand information.
headers:
'X-RateLimit-Limit':
$ref: '#/components/headers/X-RateLimit-Limit'
'X-RateLimit-Remaining':
$ref: '#/components/headers/X-RateLimit-Remaining'
'X-RateLimit-Reset':
$ref: '#/components/headers/X-RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/Brand'
BadRequestError:
description: Bad request due to invalid parameters.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
headers:
'X-RateLimit-Limit':
$ref: '#/components/headers/X-RateLimit-Limit'
'X-RateLimit-Remaining':
$ref: '#/components/headers/X-RateLimit-Remaining'
'X-RateLimit-Reset':
$ref: '#/components/headers/X-RateLimit-Reset'
UnauthorizedError:
description: Unauthorized, missing or invalid API token.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
headers:
'X-RateLimit-Limit':
$ref: '#/components/headers/X-RateLimit-Limit'
'X-RateLimit-Remaining':
$ref: '#/components/headers/X-RateLimit-Remaining'
'X-RateLimit-Reset':
$ref: '#/components/headers/X-RateLimit-Reset'
NotFoundError:
description: Brand not found.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
headers:
'X-RateLimit-Limit':
$ref: '#/components/headers/X-RateLimit-Limit'
'X-RateLimit-Remaining':
$ref: '#/components/headers/X-RateLimit-Remaining'
'X-RateLimit-Reset':
$ref: '#/components/headers/X-RateLimit-Reset'
RateLimitError:
description: Too many requests, rate limit exceeded.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
headers:
'X-RateLimit-Limit':
$ref: '#/components/headers/X-RateLimit-Limit'
'X-RateLimit-Remaining':
$ref: '#/components/headers/X-RateLimit-Remaining'
'X-RateLimit-Reset':
$ref: '#/components/headers/X-RateLimit-Reset'
'Retry-After':
$ref: '#/components/headers/Retry-After'
InternalServerError:
description: Internal server error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
headers:
X-RateLimit-Limit:
description: The number of allowed requests per time period.
schema:
type: integer
X-RateLimit-Remaining:
description: The number of remaining requests in the current time period.
schema:
type: integer
X-RateLimit-Reset:
description: The time at which the rate limit resets in UTC epoch seconds.
schema:
type: integer
Retry-After:
description: The time in seconds after which the client can retry the request.
schema:
type: integer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment