{
  "openapi": "3.1.0",
  "info": {
    "title": "Brett Farmiloe — public data API",
    "version": "1.0.0",
    "summary": "Read-only facts about Brett Farmiloe: profile, companies, podcast appearances, research and press.",
    "description": "No authentication. Every item links to its HTML page, its Markdown twin and its featured.com source. Errors share one shape, `Error`. Versioning: /api/v1/ is stable. Any breaking change ships as /api/v2/, with v1 kept for at least 90 days and announced with Deprecation and Sunset response headers and on this page.",
    "contact": {
      "name": "Brett Farmiloe",
      "url": "https://brettfarmiloe.com/contact"
    },
    "x-deprecation-policy": "/api/v1/ is stable. Any breaking change ships as /api/v2/, with v1 kept for at least 90 days and announced with Deprecation and Sunset response headers and on this page."
  },
  "externalDocs": {
    "description": "API documentation",
    "url": "https://brettfarmiloe.com/api"
  },
  "servers": [
    {
      "url": "https://brettfarmiloe.com"
    }
  ],
  "paths": {
    "/api/v1/profile.json": {
      "get": {
        "operationId": "getProfile",
        "summary": "Get Brett Farmiloe’s profile",
        "description": "Bio, roles, companies and social profiles.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "The profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/podcasts.json": {
      "get": {
        "operationId": "listPodcasts",
        "summary": "List podcast appearances",
        "description": "Every podcast appearance, newest first, with show, date, summary, key takeaways, quote and listen links.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "All podcast appearances.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count",
                    "items"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Podcast"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/research.json": {
      "get": {
        "operationId": "listResearch",
        "summary": "List research reports",
        "description": "Original research from Featured, HARO and Connectively.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "All research reports.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count",
                    "items"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Article"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/press.json": {
      "get": {
        "operationId": "listPress",
        "summary": "List press coverage and releases",
        "description": "Media mentions and press releases.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "All press items.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count",
                    "items"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Article"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/search": {
      "get": {
        "operationId": "search",
        "summary": "Search podcasts, research and press",
        "description": "Case-insensitive match on every word of q across titles, summaries, takeaways and highlights. Newest first.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Words to match, e.g. \"AI pitches\" or \"HARO\".",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Restrict to one kind of item.",
            "schema": {
              "type": "string",
              "enum": [
                "podcast",
                "research",
                "press-release",
                "media-mention"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum results.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching items.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResults"
                }
              }
            }
          },
          "400": {
            "description": "Missing q, or an invalid type or limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "hint"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable code, e.g. not_found, missing_query."
              },
              "message": {
                "type": "string",
                "description": "What went wrong."
              },
              "hint": {
                "type": "string",
                "description": "How to fix it or where to look next."
              }
            }
          }
        }
      },
      "Link": {
        "type": "object",
        "required": [
          "label",
          "url"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Takeaway": {
        "type": "object",
        "required": [
          "stat",
          "text"
        ],
        "properties": {
          "stat": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      },
      "Podcast": {
        "type": "object",
        "required": [
          "type",
          "title",
          "show",
          "published",
          "url",
          "sourceUrl"
        ],
        "properties": {
          "type": {
            "const": "podcast"
          },
          "title": {
            "type": "string"
          },
          "show": {
            "type": "string"
          },
          "published": {
            "type": "string",
            "format": "date-time"
          },
          "duration": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "markdownUrl": {
            "type": "string",
            "format": "uri"
          },
          "sourceUrl": {
            "type": "string",
            "format": "uri"
          },
          "listen": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Link"
            }
          },
          "takeaways": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Takeaway"
            }
          },
          "quote": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "text": {
                "type": "string"
              },
              "attribution": {
                "type": "string"
              }
            }
          }
        }
      },
      "Article": {
        "type": "object",
        "required": [
          "type",
          "title",
          "url",
          "sourceUrl"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "research",
              "press-release",
              "media-mention"
            ]
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "published": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "markdownUrl": {
            "type": "string",
            "format": "uri"
          },
          "sourceUrl": {
            "type": "string",
            "format": "uri"
          },
          "highlights": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Link"
            }
          }
        }
      },
      "Profile": {
        "type": "object",
        "required": [
          "name",
          "jobTitle",
          "companies"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "jobTitle": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "social": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "network": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "companies": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "summary": {
                  "type": "string"
                },
                "facts": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "page": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          }
        }
      },
      "SearchResults": {
        "type": "object",
        "required": [
          "query",
          "count",
          "results"
        ],
        "properties": {
          "query": {
            "type": "string"
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "count": {
            "type": "integer",
            "description": "Total matches before limit."
          },
          "results": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Podcast"
                },
                {
                  "$ref": "#/components/schemas/Article"
                }
              ]
            }
          }
        }
      }
    }
  }
}
