All URIs are relative to https://api.factset.com
| Method | HTTP request | Description |
|---|---|---|
| cancel_spar_calculation_by_id | DELETE /analytics/engines/spar/v2/calculations/{id} | Cancel SPAR calculation |
| get_spar_calculation_by_id | GET /analytics/engines/spar/v2/calculations/{id} | Get SPAR calculation by id |
| run_spar_calculation | POST /analytics/engines/spar/v2/calculations | Run SPAR Calculation |
cancel_spar_calculation_by_id(id)
Cancel SPAR calculation
This is the endpoint to cancel a previously submitted calculation. Instead of doing a GET on the polling URL, cancel the request by doing a DELETE
- Basic Authentication (Basic):
from __future__ import print_function
import time
import fds.analyticsapi.engines
from fds.analyticsapi.engines.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.factset.com
# See configuration.py for a list of all supported configuration parameters.
configuration = fds.analyticsapi.engines.Configuration(
host = "https://api.factset.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: Basic
configuration = fds.analyticsapi.engines.Configuration(
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD'
)
# Enter a context with an instance of the API client
with fds.analyticsapi.engines.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = fds.analyticsapi.engines.SPARCalculationsApi(api_client)
id = 'id_example' # str | from url, provided from the location header in the Run Calculation endpoint
try:
# Cancel SPAR calculation
api_instance.cancel_spar_calculation_by_id(id)
except ApiException as e:
print("Exception when calling SPARCalculationsApi->cancel_spar_calculation_by_id: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | from url, provided from the location header in the Run Calculation endpoint |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Expected response, calculation was canceled successfully. | * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 400 | Invalid identifier provided. | * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 401 | Missing or invalid authentication. | * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
| 403 | User is forbidden with current credentials | * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 404 | There was no request for the calculation identifier provided, or the request was already canceled for the provided identifier. | * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 500 | Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting. | * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
| 503 | Request timed out. Retry the request in sometime. | * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
object get_spar_calculation_by_id(id)
Get SPAR calculation by id
This is the endpoint to check on the progress of a previously requested calculation. If the calculation has finished computing, the body of the response will contain the requested document in JSON.
- Basic Authentication (Basic):
from __future__ import print_function
import time
import fds.analyticsapi.engines
from fds.analyticsapi.engines.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.factset.com
# See configuration.py for a list of all supported configuration parameters.
configuration = fds.analyticsapi.engines.Configuration(
host = "https://api.factset.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: Basic
configuration = fds.analyticsapi.engines.Configuration(
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD'
)
# Enter a context with an instance of the API client
with fds.analyticsapi.engines.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = fds.analyticsapi.engines.SPARCalculationsApi(api_client)
id = 'id_example' # str | from url, provided from the location header in the Run Calculation endpoint
try:
# Get SPAR calculation by id
api_response = api_instance.get_spar_calculation_by_id(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling SPARCalculationsApi->get_spar_calculation_by_id: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | from url, provided from the location header in the Run Calculation endpoint |
object
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Expected response once calculation is completed, returns JSON in the format specified in the Run Calculations endpoint. | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 202 | Expected response returned if the calculation is not yet completed. | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 400 | Invalid identifier provided. | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 401 | Missing or invalid authentication. | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
| 403 | User is forbidden with current credentials | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 404 | Calculation was already returned, provided id was not a requested calculation, or the calculation was cancelled | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 500 | Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
| 503 | Request timed out. Retry the request in sometime. | * Cache-Control - Standard HTTP header. Header will specify max-age in seconds. Polling can be adjusted based on the max-age value. * Content-Encoding - Standard HTTP header. Header value based on Accept-Encoding Request header. * Content-Type - Standard HTTP header. * Transfer-Encoding - Standard HTTP header. Header value will be set to Chunked if Accept-Encoding header is specified. * X-DataDirect-Request-Key - FactSet's request key header. * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
object run_spar_calculation(spar_calculation_parameters=spar_calculation_parameters)
Run SPAR Calculation
This endpoint runs the SPAR calculation specified in the POST body parameters. It must be used first before polling or cancelling endpoints. A successful response will contain the URL to poll for the result of the calculation. Remarks: * Any settings in POST body will act as a one-time override over the settings saved in the SPAR template.
- Basic Authentication (Basic):
from __future__ import print_function
import time
import fds.analyticsapi.engines
from fds.analyticsapi.engines.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.factset.com
# See configuration.py for a list of all supported configuration parameters.
configuration = fds.analyticsapi.engines.Configuration(
host = "https://api.factset.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: Basic
configuration = fds.analyticsapi.engines.Configuration(
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD'
)
# Enter a context with an instance of the API client
with fds.analyticsapi.engines.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = fds.analyticsapi.engines.SPARCalculationsApi(api_client)
spar_calculation_parameters = fds.analyticsapi.engines.SPARCalculationParameters() # SPARCalculationParameters | (optional)
try:
# Run SPAR Calculation
api_response = api_instance.run_spar_calculation(spar_calculation_parameters=spar_calculation_parameters)
pprint(api_response)
except ApiException as e:
print("Exception when calling SPARCalculationsApi->run_spar_calculation: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| spar_calculation_parameters | SPARCalculationParameters | [optional] |
object
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 202 | Expected response, contains the poll URL in the Location header. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 201 | Expected response if calculation is completed within 30 seconds, returns JSON in the format specified in the Run Calculations endpoint. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 400 | Invalid POST body. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 401 | Missing or invalid authentication. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
| 403 | User is forbidden with current credentials | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 404 | One or more calculation settings were unavailable. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 415 | Missing/Invalid Content-Type header. Header needs to be set to application/json. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. |
| 429 | Rate limit reached. Cancel older requests using Cancel Calculation endpoint or wait for older requests to finish/expire. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. * X-RateLimit-Limit - Number of allowed requests for the time window. * X-RateLimit-Remaining - Number of requests left for the time window. * X-RateLimit-Reset - Number of seconds remaining till rate limit resets. * Retry-After - Time to wait in seconds before making a new request as the rate limit has reached. |
| 500 | Server error. Log the X-DataDirect-Request-Key header to assist in troubleshooting. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
| 503 | Request timed out. Retry the request in sometime. | * Location - URL to poll for the resulting calculation * X-FactSet-Api-Request-Key - Key to uniquely identify an Analytics API request. Only available after successful authentication. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]