Functions
Insert data
Python
dataset_id: The ID of the dataset to insert into.data: A list of dictionaries containing the data to insert.
- The response from the API as a JSON object.
Retrieve data
Python
dataset_id: The ID of the dataset to retrieve from.page_size: The number of results to return per page (optional).include_fields: A list of fields to include in the response (optional).
- The response from the API as a JSON object.
Retrieve All Data
Python
dataset_id: The ID of the dataset to retrieve from.page_size: The number of results to return per page. Defaults to 1000 (optional).include_fields: A list of fields to include in the response. Defaults to None (optional).
- A list of dictionaries containing the retrieved data. Each dictionary represents a document from the dataset.
Upload a temporary file
Python
file_path_or_bytes: The path to the file or the file contents as bytes.ext: The file extension (optional).
- A dictionary containing the download URL of the uploaded file.
Prompt completion
Python
prompt_completion step with the given prompt and model.
Arguments
prompt: The prompt to complete.model: The model to use for completion (optional).
- The response from the API as a JSON object.
Run a step
Python
step_name: The name of the step to run.params: A dictionary of parameters to pass to the step.
- The response from the API as a JSON object.
Classes
Integration
Python
Integration class provides a convenient way to make authenticated API calls to OAuth-connected services in your Python code. It automatically handles OAuth token management and makes authenticated requests to third-party APIs.
Constructor Arguments
provider_name: The name of the OAuth provider/integration (e.g.,'dataforseo','hubspot','slack').account_id: The account ID from your OAuth account input. This is accessed viaparams['your_oauth_input_name']whereyour_oauth_input_nameis the variable name of your OAuth account input.
api_call()
Python
method: The HTTP method to use (e.g.,'GET','POST','PUT','DELETE').url: The full URL endpoint to make the request to.body: Optional dictionary containing the request body (for POST, PUT, etc.). Will be automatically serialized to JSON.headers: Optional dictionary of additional HTTP headers to include in the request.params: Optional dictionary of query parameters to append to the URL.
- The API response as a parsed JSON object (dictionary). The response is automatically parsed, so you can directly access the data without additional JSON parsing.
Usage Examples
Insert data
Python
Retrieve data
Python
Retrieve all
Python
Upload a temporary file
Note: Make sure to replace theregion variable with your actual region.
Python
Prompt completion
Python
Run a step
Python
Integration
Python

