---
title: "Extract text from an uploaded file"
method: POST
path: "/api/data/{project_id}/extract-from-blob"
tags: ["Data"]
---

# Extract text from an uploaded file

`POST /api/data/{project_id}/extract-from-blob`

## Request

- Base URL: `https://core.blink.new`
- URL: `https://core.blink.new/api/data/{project_id}/extract-from-blob`
- Auth: HTTP bearer

**📄 File Text Extraction from Direct Upload**

Upload a file directly via multipart form-data and extract its text content in
a single request. Supports a wide range of document formats including PDFs,
Office documents (DOCX, XLSX, PPTX), plain text files, HTML, and more.

**📤 File Upload**
Send the file using `multipart/form-data` with the file field named `file`.
Additional options (`chunking`, `chunkSize`) are passed as form fields alongside the file.

**📦 Output Modes**
- **Single string** (default, `chunking: false`) — All extracted text as one string
- **Chunked** (`chunking: true`) — Text split into fixed-size chunks, ideal for
  embedding pipelines and RAG (Retrieval-Augmented Generation) applications

**📐 Chunking**
When `chunking: true`, text is split into chunks of up to `chunkSize` characters
(minimum 1000, default 4000). Chunk boundaries respect word boundaries.

## Path parameters

- `project_id` string, required

## Request body `multipart/form-data`

- object
  - `file` string, binary, required: The file to extract text from (PDF, DOCX, XLSX, PPTX, TXT, HTML, etc.)
  - `filename` string: Optional filename hint for better format detection
  - `chunking` 'true' | 'false': Pass "true" to split extracted text into chunks
  - `chunkSize` string: Chunk size in characters as a string (minimum "1000"). Only used when chunking="true"

## Response `200`

Text extracted successfully

- ExtractFromBlobResponse
  - `chunks` string[]: Array of text chunks (when chunking=true)
  - `text` string: Complete extracted text as single string (when chunking=false)

## Other responses

- `400`: Invalid request — missing file, invalid project ID, or unsupported file type
- `401`: Authentication required or invalid API key
- `405`: Method not allowed — only POST is supported
- `413`: File too large
- `500`: Internal server error

---

[API](https://skmtc.dev/blink/apis/blink-apis.md) - [All operations](https://skmtc.dev/blink/apis/blink-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/blink/apis/blink-apis/revisions/4c59c706078e?raw)
