type=url
when the request response size is close to exceeding the maximum allowed HTTP response size (6 MB for our current infra). If you would like to make your processing code consistent and not account for the two cases, we recommend forcing the URL result by passing in the force_url_result
config parameter. Forcing the full result is not possible due to the max response payload limitation.
The URL links to a JSON object that contains the full results you should expect!
Handling URL responses
Using the Python SDK helper
The Reducto Python SDK provides a convenient helper function to automatically handle URL responses:handle_url_response
helper automatically:
- Checks if the response is a URL type
- Fetches the content from the URL if needed
- Returns a consistent
FullParseResponse
object with the complete results
Direct API usage with requests
If you’re calling the API directly without the SDK, you can handle URL responses like this:Best practices
- Consistent handling: Use
force_url_result: true
in your config to always get URL responses, making your code more predictable - Error handling: Always check for HTTP errors when fetching from the URL
- Timeout handling: Set appropriate timeouts when fetching URL content
- URL expiration: The URLs have an expiration time, so fetch the content promptly after receiving the response