The Brand Object

Recipes

Code that passes brand context to a model, in TypeScript and Python: prompts, JSON or Markdown, caching, failures, prospects, customers and agents.

Each recipe gives working code for one job that comes after the request. Each recipe uses the endpoints and responses on this site and names the keys that it reads. It links to the vendor's documentation for anything that changes. The code calls the APIs with fetch in TypeScript and httpx in Python. It uses no software development kit (SDK), so you can see each request and each response.

  1. Brand context in a system promptTurn a brand context response into a system prompt: which fields to include, how to word them as instructions, and code in TypeScript and Python for Brandfetch.
  2. JSON or Markdown?When to ask a brand context API for Markdown and when to keep JSON: Brandfetch offers both, Rainbrand's guidance is Markdown inside JSON, the rest is JSON.
  3. Cache, refresh and pin a versionHow old each brand context API's data can be, what its docs say about storing it, when to ask again, and how to record which context a piece of work used.
  4. Slow, empty and failed responsesHandle the responses that are not a 200: the Brandfetch 503 while it builds a profile, the Logo.dev 202 while it indexes, cache misses and rate limits.
  5. Personalize for a prospect's brandUse observed brand context to write to a company that you do not work with yet: from a work email to a first line in its terms, with code and limits.
  6. Customer brands in your product's jobsFor products that make work for their customers' brands: an observed lookup at signup, then each customer's own brand context for every job, with code.
  7. Brand context for agents over MCPWhich brand context APIs have a Model Context Protocol server for Claude, ChatGPT or Cursor, the tools each one has, how they sign in, and what agents get back.