{
  "openapi": "3.1.0",
  "info": {
    "title": "CreditBase public API",
    "version": "1.0.0",
    "summary": "Free credits, perks, grants and government schemes for founders, students and makers.",
    "description": "A read-only JSON API over the CreditBase directory. It returns the same public fields as the website's program pages.\n\n**Authentication:** none. Every operation is public and read-only, so there are no API keys, OAuth flows or scopes, and nothing to sign up for.\n\n**Rate limit:** requests are limited per IP address; a 429 response carries Retry-After. Pace bulk reads with the limit and offset parameters.\n\n**Data:** values are up-to amounts and terms change; confirm on the provider's page (apply_url). Records with an attribution field must be credited as stated.",
    "termsOfService": "https://creditbase.in/terms",
    "contact": {
      "name": "CreditBase team",
      "url": "https://creditbase.in/contact"
    }
  },
  "servers": [
    {
      "url": "https://creditbase.in",
      "description": "Production"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "Programs",
      "description": "The directory of programs."
    }
  ],
  "externalDocs": {
    "description": "Developer guide, examples and the CLI",
    "url": "https://creditbase.in/developers"
  },
  "paths": {
    "/v1/programs": {
      "get": {
        "operationId": "searchPrograms",
        "summary": "Search programs",
        "description": "Search the directory of free credits, tool perks, grants, accelerators and government schemes for founders, students and makers. Filters combine with AND. Results are sorted by value, largest first. Use this to answer questions such as which programs a company in a given country can claim.",
        "tags": [
          "Programs"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Words to look for in a program's name, provider, category, description, value and countries. Every word must match.",
            "schema": {
              "type": "string",
              "examples": [
                "gpu credits"
              ]
            }
          },
          {
            "name": "country",
            "in": "query",
            "description": "ISO country code (or GLOBAL for worldwide-only programs). Returns programs available to a company registered there, including worldwide ones.",
            "schema": {
              "type": "string",
              "enum": [
                "GLOBAL",
                "US",
                "CA",
                "GB",
                "EU",
                "DE",
                "FR",
                "NL",
                "IE",
                "ES",
                "IT",
                "SE",
                "FI",
                "CH",
                "IN",
                "SG",
                "AU",
                "JP",
                "KR",
                "HK",
                "BR",
                "CL",
                "AE",
                "IL",
                "GLOBAL"
              ],
              "examples": [
                "IN"
              ]
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Kind of program.",
            "schema": {
              "type": "string",
              "enum": [
                "credits",
                "discount",
                "grant",
                "govt",
                "accelerator"
              ]
            }
          },
          {
            "name": "category",
            "in": "query",
            "description": "Category name, case-insensitive. List them with getFacets.",
            "schema": {
              "type": "string",
              "examples": [
                "Cloud"
              ]
            }
          },
          {
            "name": "audience",
            "in": "query",
            "description": "Who can claim it: registered startups, students or individual makers.",
            "schema": {
              "type": "string",
              "enum": [
                "founders",
                "students",
                "makers"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "How many programs to return (1 to 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "How many matching programs to skip, for paging.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgramList"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is invalid; the message says which values are allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address. Wait the number of seconds in Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/programs/{id}": {
      "get": {
        "operationId": "getProgram",
        "summary": "Get one program",
        "description": "Fetch one program by id: the value, who qualifies, where it is available, the provider's official apply link and when it was last checked. Programs that have ended are returned with status \"discontinued\".",
        "tags": [
          "Programs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Program id, as returned by searchPrograms (for example aws-activate).",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "aws-activate"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Program"
                }
              }
            }
          },
          "404": {
            "description": "No program with that id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address. Wait the number of seconds in Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/facets": {
      "get": {
        "operationId": "getFacets",
        "summary": "List the filter values",
        "description": "The values the search filters accept (types, categories, audiences and country codes) with how many programs each holds, and the date the data was last updated.",
        "tags": [
          "Programs"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Facets"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address. Wait the number of seconds in Retry-After.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Machine-readable error code.",
                "enum": [
                  "invalid_parameter",
                  "not_found"
                ]
              },
              "message": {
                "type": "string",
                "description": "What went wrong and how to fix it."
              }
            }
          }
        }
      },
      "Program": {
        "type": "object",
        "description": "One program as shown on its public page.",
        "required": [
          "id",
          "name",
          "provider",
          "category",
          "type",
          "countries",
          "audience",
          "value",
          "description",
          "eligibility",
          "status",
          "apply_url",
          "page_url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable identifier; the program page is page_url."
          },
          "name": {
            "type": "string",
            "description": "Program name."
          },
          "provider": {
            "type": "string",
            "description": "Company or body that runs it."
          },
          "category": {
            "type": "string",
            "description": "Category, for example Cloud."
          },
          "type": {
            "type": "string",
            "description": "Kind of program.",
            "enum": [
              "credits",
              "discount",
              "grant",
              "govt",
              "accelerator"
            ]
          },
          "type_label": {
            "type": "string",
            "description": "Display name of the type."
          },
          "countries": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "ISO country codes, GLOBAL for worldwide, or EU."
          },
          "region": {
            "type": "string",
            "description": "Set when the program is limited to a region inside the country."
          },
          "audience": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "founders",
                "students",
                "makers"
              ]
            },
            "description": "Who can claim it."
          },
          "value": {
            "type": "string",
            "description": "Headline value, usually an up-to amount."
          },
          "value_usd": {
            "type": "number",
            "description": "The value in US dollars, for sorting."
          },
          "description": {
            "type": "string",
            "description": "What the program gives."
          },
          "eligibility": {
            "type": "string",
            "description": "Who qualifies."
          },
          "benefits": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Listed benefits."
          },
          "status": {
            "type": "string",
            "description": "live, unverified (terms not checked recently) or discontinued.",
            "enum": [
              "live",
              "unverified",
              "discontinued"
            ]
          },
          "last_verified": {
            "type": "string",
            "description": "Date the terms were last checked (YYYY-MM-DD).",
            "format": "date"
          },
          "apply_url": {
            "type": "string",
            "description": "The provider's official page. Values are up-to amounts: confirm terms there.",
            "format": "uri"
          },
          "page_url": {
            "type": "string",
            "description": "The program's page on CreditBase.",
            "format": "uri"
          },
          "attribution": {
            "type": "string",
            "description": "Present when the record is adapted from a CC BY 4.0 source that must be credited."
          }
        }
      },
      "ProgramList": {
        "type": "object",
        "required": [
          "total",
          "limit",
          "offset",
          "updated_at",
          "programs"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Programs matching the filters."
          },
          "limit": {
            "type": "integer",
            "description": "Page size used."
          },
          "offset": {
            "type": "integer",
            "description": "Programs skipped."
          },
          "updated_at": {
            "type": "string",
            "description": "When the data was last updated.",
            "format": "date-time"
          },
          "programs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Program"
            }
          }
        }
      },
      "Facets": {
        "type": "object",
        "required": [
          "updated_at",
          "types",
          "categories",
          "audiences",
          "countries"
        ],
        "properties": {
          "updated_at": {
            "type": "string",
            "description": "When the data was last updated.",
            "format": "date-time"
          },
          "types": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          },
          "audiences": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "countries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    }
  }
}