{
 "openapi": "3.1.0",
 "info": {
  "title": "Inmigreat public data API",
  "version": "1.0.0",
  "summary": "U.S. immigration court (EOIR) judges and courts, USCIS statistics by form and field office, processing times, TPS notices and plain-language glossaries.",
  "description": "Read-only and public, at no cost. No API key. Every figure comes from a public government source (EOIR case data, USCIS reports, the Federal Register) and every response says its source, its data date and how to cite it. Data, not legal advice. Inmigreat is not part of the government. An MCP server with the same data is at https://mcp.inmigreat.com/mcp.",
  "contact": {
   "name": "Inmigreat",
   "email": "press@inmigreat.com",
   "url": "https://www.inmigreat.com/en/developers/"
  },
  "license": {
   "name": "Creative Commons Attribution 4.0 International",
   "identifier": "CC-BY-4.0",
   "url": "https://creativecommons.org/licenses/by/4.0/"
  },
  "x-mcp-server": "https://mcp.inmigreat.com/mcp"
 },
 "externalDocs": {
  "description": "Open data catalog, column dictionary and how to cite",
  "url": "https://www.inmigreat.com/en/open-data/"
 },
 "servers": [
  {
   "url": "https://data.inmigreat.com/v1",
   "description": "Production"
  }
 ],
 "security": [],
 "paths": {
  "/search": {
   "get": {
    "operationId": "search",
    "summary": "Search: find Inmigreat pages",
    "description": "Searches every public Inmigreat page (judges, courts, USCIS forms and field offices, TPS countries, guides, case statuses) and returns the best matches with their URL.",
    "tags": [
     "Search"
    ],
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 2
      },
      "example": "Miami USCIS field office"
     },
     {
      "name": "lang",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "es",
        "en"
       ]
      }
     },
     {
      "name": "kind",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "juez, corte, oficina, estadistica, tiempos, tps, estatus, guide, hub, pais, lugar"
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 25,
       "default": 10
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Matches",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SearchResult"
        }
       }
      }
     },
     "400": {
      "description": "Missing or too short q (at least 2 characters)"
     }
    }
   }
  },
  "/catalog.json": {
   "get": {
    "operationId": "catalog",
    "summary": "Catalog: every dataset",
    "description": "Machine-readable catalog: datasets, files, columns, sources, license.",
    "tags": [
     "Catalog"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "Catalog",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/indice.json": {
   "get": {
    "operationId": "pageIndex",
    "summary": "Catalog: every public page",
    "description": "Every indexable page of www.inmigreat.com with title, description, kind and language.",
    "tags": [
     "Catalog"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "Page index",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/jueces.json": {
   "get": {
    "operationId": "judges",
    "summary": "Judges: every immigration judge",
    "description": "One row per EOIR immigration judge: decisions, relief, removal, voluntary departure, closures, in absentia, representation and median days (12-month window).",
    "tags": [
     "Judges"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "Judges",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/jueces.csv": {
   "get": {
    "operationId": "judgesCsv",
    "summary": "Judges: every immigration judge (CSV)",
    "description": "Same as /jueces.json as CSV.",
    "tags": [
     "Judges"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "Judges CSV",
      "content": {
       "text/csv": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/jueces/{court}/{judge}.json": {
   "get": {
    "operationId": "judge",
    "summary": "Judges: one judge",
    "description": "One judge with outcomes, representation, nationalities and months. Slugs as in /jueces.json (court_slug, json_url).",
    "tags": [
     "Judges"
    ],
    "parameters": [
     {
      "name": "court",
      "in": "path",
      "required": true,
      "description": "Court slug",
      "schema": {
       "type": "string"
      },
      "example": "adelanto"
     },
     {
      "name": "judge",
      "in": "path",
      "required": true,
      "description": "Judge slug",
      "schema": {
       "type": "string"
      },
      "example": "barrett-patrick-d"
     }
    ],
    "responses": {
     "200": {
      "description": "Judge",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/cortes.json": {
   "get": {
    "operationId": "courts",
    "summary": "Courts: every immigration court",
    "description": "One row per EOIR immigration court with address, judges and outcomes.",
    "tags": [
     "Courts"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "Courts",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/estadisticas/{form}.json": {
   "get": {
    "operationId": "uscisFormStats",
    "summary": "USCIS: national statistics of one form",
    "description": "Latest quarter (received, approved, denied, pending), change in a year, Inmigreat estimates, categories and every quarter with its official USCIS file.",
    "tags": [
     "USCIS"
    ],
    "parameters": [
     {
      "name": "form",
      "in": "path",
      "required": true,
      "description": "USCIS form",
      "schema": {
       "type": "string",
       "enum": [
        "i-485",
        "i-130",
        "n-400",
        "i-765"
       ]
      },
      "example": "i-485"
     }
    ],
    "responses": {
     "200": {
      "description": "Form statistics",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/volumenes/{form}.csv": {
   "get": {
    "operationId": "uscisVolumesCsv",
    "summary": "USCIS: volumes by quarter, office and category (CSV)",
    "description": "Long table: one row per quarter × national/office × category (I-765: × eligibility category and filing type).",
    "tags": [
     "USCIS"
    ],
    "parameters": [
     {
      "name": "form",
      "in": "path",
      "required": true,
      "description": "USCIS form",
      "schema": {
       "type": "string",
       "enum": [
        "i-485",
        "i-130",
        "n-400",
        "i-765"
       ]
      },
      "example": "n-400"
     }
    ],
    "responses": {
     "200": {
      "description": "Volumes CSV",
      "content": {
       "text/csv": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/oficinas-uscis.json": {
   "get": {
    "operationId": "uscisOffices",
    "summary": "USCIS: every field office",
    "description": "One row per field office or center × form (I-485, N-400, I-130) with latest indicators, rank and estimates.",
    "tags": [
     "USCIS"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "Field offices",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/oficinas/{office}.json": {
   "get": {
    "operationId": "uscisOffice",
    "summary": "USCIS: one field office",
    "description": "Full quarterly history of one field office or center. Slugs as in /oficinas-uscis.json (json_url), e.g. miami-fl.",
    "tags": [
     "USCIS"
    ],
    "parameters": [
     {
      "name": "office",
      "in": "path",
      "required": true,
      "description": "Office slug",
      "schema": {
       "type": "string"
      },
      "example": "miami-fl"
     }
    ],
    "responses": {
     "200": {
      "description": "Field office",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/tiempos/{form}.json": {
   "get": {
    "operationId": "processingTimes",
    "summary": "USCIS: processing times of one form",
    "description": "Official USCIS quarterly medians and the monthly report to Congress (average, not median), kept apart.",
    "tags": [
     "USCIS"
    ],
    "parameters": [
     {
      "name": "form",
      "in": "path",
      "required": true,
      "description": "USCIS form",
      "schema": {
       "type": "string"
      },
      "example": "i-485"
     }
    ],
    "responses": {
     "200": {
      "description": "Processing times",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/tps.json": {
   "get": {
    "operationId": "tps",
    "summary": "TPS: Federal Register notices",
    "description": "Every Federal Register notice on Temporary Protected Status since 2010, with country, type, dates, citation and link.",
    "tags": [
     "TPS"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "TPS notices",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/estatus.json": {
   "get": {
    "operationId": "caseStatuses",
    "summary": "Glossary: USCIS case statuses",
    "description": "Exact USCIS case status texts with a plain explanation in Spanish and English.",
    "tags": [
     "Glossary"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "Case statuses",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/glosario-eoir.json": {
   "get": {
    "operationId": "courtGlossary",
    "summary": "Glossary: immigration court terms",
    "description": "Immigration court (EOIR) terms in plain words, each with the EOIR Policy Manual page it was checked against.",
    "tags": [
     "Glossary"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "Court glossary",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Envelope": {
    "type": "object",
    "description": "Every JSON file carries dataset, title, url, documentation, license, attribution, sources, temporalCoverage, updated and disclaimer, plus its data (rows, or the record fields).",
    "properties": {
     "dataset": {
      "type": [
       "string",
       "null"
      ]
     },
     "url": {
      "type": "string",
      "format": "uri"
     },
     "license": {
      "type": "object"
     },
     "attribution": {
      "type": "object"
     },
     "sources": {
      "type": "array",
      "items": {
       "type": "object"
      }
     },
     "updated": {
      "type": [
       "string",
       "null"
      ]
     },
     "disclaimer": {
      "type": "object"
     },
     "rows": {
      "type": "array",
      "items": {
       "type": "object"
      }
     }
    },
    "additionalProperties": true
   },
   "SearchResult": {
    "type": "object",
    "properties": {
     "query": {
      "type": "string"
     },
     "results": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "url": {
         "type": "string",
         "format": "uri"
        },
        "title": {
         "type": "string"
        },
        "description": {
         "type": "string"
        },
        "kind": {
         "type": "string"
        },
        "lang": {
         "type": "string"
        },
        "score": {
         "type": "number"
        }
       }
      }
     }
    }
   }
  }
 }
}