API Loader
Load data from an API.

The API Document Loader provides functionality to load and process data from external APIs using HTTP requests. This module enables seamless integration with RESTful APIs and web services.
This module provides a versatile API document loader that can:
Make HTTP GET and POST requests
Handle custom headers and request bodies
Process API responses into documents
Support JSON data structures
Customize metadata extraction
Process responses with text splitters
Inputs
Required Parameters
URL: The API endpoint URL to call
Method: HTTP method to use (GET or POST)
Optional Parameters
Headers: JSON object containing HTTP headers
Body: JSON object for POST request body
Text Splitter: A text splitter to process the extracted content
Additional Metadata: JSON object with additional metadata
Omit Metadata Keys: Comma-separated list of metadata keys to omit
Outputs
Document: Array of document objects containing metadata and pageContent
Text: Concatenated string from pageContent of documents
Features
HTTP method support (GET/POST)
Custom header configuration
Request body customization
Response processing
Error handling
Metadata customization
Text splitting capabilities
Example Usage
GET Request
POST Request
Notes
Supports JSON request/response formats
Handles HTTP error responses
Automatically processes response data into documents
Can be combined with text splitters for content processing
Supports custom metadata addition and omission
Error responses are properly handled and reported
Last updated