{
 "openapi": "3.1.0",
 "info": {
  "title": "RunningPodcasts.com search",
  "version": "1.0.0",
  "description": "Keyword search over RunningPodcasts.com's own transcripts (made from the episode audio), episode notes and show guides. Free, no key. When you quote, link the snippet url. Docs: https://runningpodcasts.com/agents#searching",
  "contact": {
   "url": "https://runningpodcasts.com/contact"
  },
  "license": {
   "name": "Free to use with a link to the page on runningpodcasts.com",
   "url": "https://runningpodcasts.com/agents"
  }
 },
 "servers": [
  {
   "url": "https://runningpodcasts.com"
  }
 ],
 "paths": {
  "/api/search": {
   "get": {
    "operationId": "searchTranscripts",
    "summary": "Search running podcast transcripts, episode notes and show guides",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "maxLength": 100
      },
      "description": "Words to find. Every word must be in the same passage; \"quotes\" for an exact phrase."
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1
      },
      "description": "Page of episodes"
     },
     {
      "name": "offset",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 0
      },
      "description": "Episodes to skip (use instead of page)"
     },
     {
      "name": "per_page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 25,
       "default": 25
      },
      "description": "Episodes per page"
     },
     {
      "name": "per_episode",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 50,
       "default": 3
      },
      "description": "Snippets per episode"
     },
     {
      "name": "client",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 60
      },
      "description": "Optional: your app, agent or project name, so we know who uses the data"
     }
    ],
    "responses": {
     "200": {
      "description": "Results grouped by show, then episode",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "query": {
           "type": "string"
          },
          "used_query": {
           "type": [
            "string",
            "null"
           ]
          },
          "suggested_spelling": {
           "type": "boolean"
          },
          "match": {
           "type": "string",
           "enum": [
            "all",
            "any"
           ]
          },
          "ignored_words": {
           "type": "array",
           "items": {
            "type": "string"
           },
           "description": "Common words left out because no passage had every word"
          },
          "synonyms_used": {
           "type": "array",
           "items": {
            "type": "object"
           }
          },
          "total_passages": {
           "type": "integer"
          },
          "total_passages_capped": {
           "type": "boolean"
          },
          "total_episodes": {
           "type": "integer"
          },
          "page": {
           "type": "integer"
          },
          "per_page": {
           "type": "integer"
          },
          "offset": {
           "type": "integer"
          },
          "per_episode": {
           "type": "integer"
          },
          "episodes_on_page": {
           "type": "integer"
          },
          "next_page_url": {
           "type": [
            "string",
            "null"
           ],
           "format": "uri"
          },
          "prev_page_url": {
           "type": [
            "string",
            "null"
           ],
           "format": "uri"
          },
          "web_url": {
           "type": "string",
           "format": "uri"
          },
          "shows": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "show": {
              "type": "string"
             },
             "show_url": {
              "type": "string",
              "format": "uri"
             },
             "episodes_matching": {
              "type": "integer"
             },
             "show_match": {
              "type": [
               "object",
               "null"
              ]
             },
             "more_episodes": {
              "type": "integer",
              "description": "Matching episodes of this show not on this page"
             },
             "episodes": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "title": {
                 "type": "string"
                },
                "date": {
                 "type": "string",
                 "format": "date"
                },
                "url": {
                 "type": "string",
                 "format": "uri"
                },
                "mentions": {
                 "type": "integer",
                 "description": "Matching passages in this episode"
                },
                "cite_as": {
                 "type": "string"
                },
                "snippets": {
                 "type": "array",
                 "items": {
                  "type": "object",
                  "properties": {
                   "text": {
                    "type": "string",
                    "description": "Passage text; matched words are marked [[ ]]"
                   },
                   "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Canonical URL of that moment (transcript #anchor or notes section). Link this when you quote."
                   },
                   "source": {
                    "type": "string",
                    "enum": [
                     "transcript",
                     "notes"
                    ]
                   },
                   "where": {
                    "type": "string",
                    "description": "Same as source (kept for older clients)"
                   },
                   "time": {
                    "type": [
                     "string",
                     "null"
                    ],
                    "description": "Time in the audio (m:ss or h:mm:ss); null for notes"
                   },
                   "speaker": {
                    "type": [
                     "string",
                     "null"
                    ],
                    "description": "Who is speaking; null for notes or when not known"
                   },
                   "notes_section_starts_at": {
                    "type": [
                     "string",
                     "null"
                    ],
                    "description": "Notes only: where that notes section begins in the audio"
                   },
                   "cite_as": {
                    "type": "string"
                   }
                  }
                 }
                }
               }
              }
             }
            }
           }
          },
          "source": {
           "type": "string"
          },
          "attribution": {
           "type": "object",
           "properties": {
            "publisher": {
             "type": "string"
            },
            "publisher_url": {
             "type": "string"
            },
            "how_to_cite": {
             "type": "string"
            },
            "license": {
             "type": "string"
            },
            "docs": {
             "type": "string"
            },
            "openapi": {
             "type": "string"
            }
           }
          },
          "limits": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "No q given"
     },
     "429": {
      "description": "More than 30 requests a minute or 3,000 a day from one connection; see Retry-After"
     },
     "503": {
      "description": "Search not available"
     }
    }
   }
  },
  "/search/index.md": {
   "get": {
    "operationId": "searchTranscriptsMarkdown",
    "summary": "The same search, answered as Markdown",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "maxLength": 100
      },
      "description": "Words to find. Every word must be in the same passage; \"quotes\" for an exact phrase."
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1
      },
      "description": "Page of episodes"
     },
     {
      "name": "offset",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 0
      },
      "description": "Episodes to skip (use instead of page)"
     },
     {
      "name": "per_page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 25,
       "default": 25
      },
      "description": "Episodes per page"
     },
     {
      "name": "per_episode",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 50,
       "default": 3
      },
      "description": "Snippets per episode"
     },
     {
      "name": "client",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 60
      },
      "description": "Optional: your app, agent or project name, so we know who uses the data"
     }
    ],
    "responses": {
     "200": {
      "description": "Markdown results",
      "content": {
       "text/markdown": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  }
 }
}