Async flow
- Call one of the ingest methods (
ingest_file,ingest_url,ingest_github,ingest_youtube). The method returns abuild_id. - Call
get_build_status(build_id)to poll. When the returned status is completed, use thefile_idfor ask, extract, list elements, delete, etc.
Available Methods
- Python
- TypeScript
Get build status
client.sources.get_build_status(build_id)Poll status and optional elements for an async ingestionIngest file
client.sources.ingest_file()Upload a local file; processing runs in the backgroundIngest URL
client.sources.ingest_url()Ingest a public web page by URL (async)Ingest GitHub
client.sources.ingest_github()Ingest a public GitHub repository (async)Ingest YouTube
client.sources.ingest_youtube()Ingest a public YouTube video (async)Installation
- Python
- TypeScript
Python 3.9 or higher is required.
Authentication
All SDK methods require authentication using an API key. You can provide your API key in two ways:Environment Variable (Recommended)
Set theGRAPHOR_API_KEY environment variable:
- Python
- TypeScript
Direct Initialization
- Python
- TypeScript
Learn how to create and manage API tokens in the API Tokens guide.
Get build status
Poll the status of an async ingestion (or reprocess). Use the build_id returned by any ingest method or by reprocess.Method Signature
- Python
- TypeScript
Return value
When the build has been persisted, the response includessuccess, status, file_id, file_name, and optionally paginated elements. Possible status values:
Completed— Build finished successfully; usefile_idfor subsequent calls.Processing— Build is running; keep polling.Pending— Request was received but the build has not started yet; keep polling.Processing failed— Build failed; checkerrorfor details.not_found— No history yet (build not started or invalidbuild_id).
file_id from a response where success is true for subsequent API calls.
Poll until complete
- Python
- TypeScript
Ingest file
Upload a local file and schedule ingestion in the background. Returns a build_id; use Get build status to poll until the source is ready.Method Signature
- Python
- TypeScript
SourceIngestFileResponse with .build_id.Parameters
- Python
- TypeScript
Partition methods
When provided,method controls how the document is parsed. If omitted, the system default is used.
For more details, see Reprocess source documentation.
File requirements
Supported file types
Supported file types
Documents: PDF, DOC, DOCX, ODT, TXT, TEXT, MD, HTML, HTM · Presentations: PPT, PPTX · Spreadsheets: CSV, TSV, XLS, XLSX · Images: PNG, JPG, JPEG, TIFF, BMP, HEIC · Audio: MP3, WAV, M4A, OGG, FLAC · Video: MP4, MOV, AVI, MKV, WEBM
File size limits
File size limits
Maximum file size: 100 MB per file. The request must include a Content-Length so the server can enforce the limit.
Code examples
Ingest file and poll until ready
- Python
- TypeScript
Ingest with partition method
- Python
- TypeScript
Ingest from bytes / buffer
- Python
- TypeScript
Batch ingest (returns build_ids)
- Python
- TypeScript
Error handling
Ingest methods throw on invalid file type, missing Content-Length, size over 100 MB, or server errors. Use Get build status to detect processing failures (e.g.status.error).
- Python
- TypeScript
Ingest URL
Ingest a web page by URL (async). Returns a build_id; use Get build status to poll until ready.Method signature
- Python
- TypeScript
SourceIngestURLResponse with .build_id.Parameters
- Python
- TypeScript
URL Requirements
Supported URL types
Supported URL types
- Public web pages
- Pages that render primary content server-side and are reachable without interaction
Access requirements
Access requirements
- The URL must be publicly reachable over HTTPS
- Authentication-protected pages are not supported
Code Examples
Basic URL ingest
- Python
- TypeScript
Ingest with crawling
- Python
- TypeScript
Ingest GitHub
Ingest a public GitHub repository (async). Returns a build_id; use Get build status to poll until ready.Method signature
- Python
- TypeScript
Parameters
- Python
- TypeScript
Repository Requirements
Supported URLs
Supported URLs
- Public GitHub repositories
- HTTPS URLs (
https://github.com/...)
Access requirements
Access requirements
- Only public repositories are supported
- Private repository ingestion is not supported
Code Examples
Basic GitHub ingest
- Python
- TypeScript
Ingest YouTube
Ingest a public YouTube video (async). Returns a build_id; use Get build status to poll until ready.Method signature
- Python
- TypeScript
Parameters
- Python
- TypeScript
Video Requirements
Supported URLs
Supported URLs
- Public YouTube video URLs (HTTPS)
- Standard watch URLs (
https://www.youtube.com/watch?v=VIDEO_ID)
Access requirements
Access requirements
- The video must be publicly accessible
- Private or access-restricted videos are not supported
Code Examples
Basic YouTube ingest
- Python
- TypeScript
Advanced Configuration
Custom timeout
For large files or slow connections, increase the ingest request timeout. Use Get build status with a suitable poll interval for long-running processing.- Python
- TypeScript
Retry configuration
Configure automatic retries for transient errors on ingest or get_build_status:- Python
- TypeScript
Accessing raw response (Python only)
Using aiohttp for concurrency (Python only)
Error Reference
Next Steps
After ingesting, use Get build status to wait until processing completes, then:Reprocess source
Reprocess a source with a different partition method
List sources
List all sources (optionally filter by file_ids)
Get elements
Retrieve parsed elements/chunks from a source
Delete source
Remove a source by file_id

