AcademicObservatoryApi¶
All URIs are relative to https://ao.api.observatory.academy
| Method | HTTP request | Description |
|---|---|---|
| pit_id_agg | GET /v1/{agg}/pit | |
| pit_id_subagg | GET /v1/{agg}/{subagg}/pit | |
| query_agg | GET /v1/{agg} | |
| query_subagg | GET /v1/{agg}/{subagg} |
pit_id_agg¶
PitResponse pit_id_agg(agg)
Example¶
Api Key Authentication (api_key):
import time
import academic_observatory_api.client
from academic_observatory_api.client.api import academic_observatory_api
from academic_observatory_api.client.model.pit_response import PitResponse
from pprint import pprint
# Defining the host is optional and defaults to https://ao.api.observatory.academy
# See configuration.py for a list of all supported configuration parameters.
configuration = academic_observatory_api.client.Configuration(
host = "https://ao.api.observatory.academy"
)
# 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 API key authorization: api_key
configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'
# Enter a context with an instance of the API client
with academic_observatory_api.client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = academic_observatory_api.AcademicObservatoryApi(api_client)
agg = "author" # str | The aggregate.
index_date = dateutil_parser('1970-01-01').date() # date | Index date, defaults to latest (optional)
keep_alive = 1 # int | How long to keep the point in time id alive (in minutes) (optional)
# example passing only required values which don't have defaults set
try:
api_response = api_instance.pit_id_agg(agg)
pprint(api_response)
except academic_observatory_api.client.ApiException as e:
print("Exception when calling AcademicObservatoryApi->pit_id_agg: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.pit_id_agg(agg, index_date=index_date, keep_alive=keep_alive)
pprint(api_response)
except academic_observatory_api.client.ApiException as e:
print("Exception when calling AcademicObservatoryApi->pit_id_agg: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| agg | str | The aggregate. | |
| index_date | date | Index date, defaults to latest | [optional] |
| keep_alive | int | How long to keep the point in time id alive (in minutes) | [optional] |
Return type¶
HTTP request headers¶
Content-Type: Not defined
Accept: application/json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | Create a new pit id for the specified aggregate. When creating a Point In Time the current index state is preserved for a limited time. This specific state can be used by passing on the pit id as a parameter to the search request. Each search request can return a different id; thus always use the most recently received id for the next search request. | - |
| 401 | API key is missing or invalid | * WWW_Authenticate - |
pit_id_subagg¶
PitResponse pit_id_subagg(agg, subagg)
Example¶
Api Key Authentication (api_key):
import time
import academic_observatory_api.client
from academic_observatory_api.client.api import academic_observatory_api
from academic_observatory_api.client.model.pit_response import PitResponse
from pprint import pprint
# Defining the host is optional and defaults to https://ao.api.observatory.academy
# See configuration.py for a list of all supported configuration parameters.
configuration = academic_observatory_api.client.Configuration(
host = "https://ao.api.observatory.academy"
)
# 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 API key authorization: api_key
configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'
# Enter a context with an instance of the API client
with academic_observatory_api.client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = academic_observatory_api.AcademicObservatoryApi(api_client)
agg = "author" # str | The aggregate.
subagg = "access-types" # str | The sub-aggregate.
index_date = dateutil_parser('1970-01-01').date() # date | Index date, defaults to latest (optional)
keep_alive = 1 # int | How long to keep the point in time id alive (in minutes) (optional)
# example passing only required values which don't have defaults set
try:
api_response = api_instance.pit_id_subagg(agg, subagg)
pprint(api_response)
except academic_observatory_api.client.ApiException as e:
print("Exception when calling AcademicObservatoryApi->pit_id_subagg: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.pit_id_subagg(agg, subagg, index_date=index_date, keep_alive=keep_alive)
pprint(api_response)
except academic_observatory_api.client.ApiException as e:
print("Exception when calling AcademicObservatoryApi->pit_id_subagg: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| agg | str | The aggregate. | |
| subagg | str | The sub-aggregate. | |
| index_date | date | Index date, defaults to latest | [optional] |
| keep_alive | int | How long to keep the point in time id alive (in minutes) | [optional] |
Return type¶
HTTP request headers¶
Content-Type: Not defined
Accept: application/json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | Create a new pit id for the specified aggregate and subaggregate. When creating a Point In Time the current index state is preserved for a limited time. This specific state can be used by passing on the pit id as a parameter to the search request. Each search request can return a different id; thus always use the most recently received id for the next search request. | - |
| 401 | API key is missing or invalid | * WWW_Authenticate - |
query_agg¶
QueryResponse query_agg(agg)
Example¶
Api Key Authentication (api_key):
import time
import academic_observatory_api.client
from academic_observatory_api.client.api import academic_observatory_api
from academic_observatory_api.client.model.query_response import QueryResponse
from pprint import pprint
# Defining the host is optional and defaults to https://ao.api.observatory.academy
# See configuration.py for a list of all supported configuration parameters.
configuration = academic_observatory_api.client.Configuration(
host = "https://ao.api.observatory.academy"
)
# 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 API key authorization: api_key
configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'
# Enter a context with an instance of the API client
with academic_observatory_api.client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = academic_observatory_api.AcademicObservatoryApi(api_client)
agg = "author" # str | The aggregate.
agg_id = [
"agg_id_example",
] # [str] | Filter on aggregates with this id, if multiple values are given the results are filtered on whether there are aggregates with one of the given values. (optional)
index_date = dateutil_parser('1970-01-01').date() # date | Index date, defaults to latest (optional)
_from = dateutil_parser('1970-01-01').date() # date | Start year (included) (optional)
to = dateutil_parser('1970-01-01').date() # date | End year (included) (optional)
limit = 1 # int | Limit number of results (max 10000) (optional)
search_after = "search_after_example" # str | The sort value of the last item from the previous search, used to paginate. The results are sorted by _shard_doc when a PIT is used and by document id (_id) without a PIT. (optional)
pit = "pit_example" # str | The pit id (optional)
pretty = True # bool | If true, the endpoint returns only the user metadata. (optional)
# example passing only required values which don't have defaults set
try:
api_response = api_instance.query_agg(agg)
pprint(api_response)
except academic_observatory_api.client.ApiException as e:
print("Exception when calling AcademicObservatoryApi->query_agg: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.query_agg(agg, agg_id=agg_id, index_date=index_date, _from=_from, to=to, limit=limit, search_after=search_after, pit=pit, pretty=pretty)
pprint(api_response)
except academic_observatory_api.client.ApiException as e:
print("Exception when calling AcademicObservatoryApi->query_agg: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| agg | str | The aggregate. | |
| agg_id | [str] | Filter on aggregates with this id, if multiple values are given the results are filtered on whether there are aggregates with one of the given values. | [optional] |
| index_date | date | Index date, defaults to latest | [optional] |
| _from | date | Start year (included) | [optional] |
| to | date | End year (included) | [optional] |
| limit | int | Limit number of results (max 10000) | [optional] |
| search_after | str | The sort value of the last item from the previous search, used to paginate. The results are sorted by _shard_doc when a PIT is used and by document id (_id) without a PIT. | [optional] |
| pit | str | The pit id | [optional] |
| pretty | bool | If true, the endpoint returns only the user metadata. | [optional] |
Return type¶
HTTP request headers¶
Content-Type: Not defined
Accept: application/json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully return query results | - |
| 401 | API key is missing or invalid | * WWW_Authenticate - |
query_subagg¶
QueryResponse query_subagg(agg, subagg)
Example¶
Api Key Authentication (api_key):
import time
import academic_observatory_api.client
from academic_observatory_api.client.api import academic_observatory_api
from academic_observatory_api.client.model.query_response import QueryResponse
from pprint import pprint
# Defining the host is optional and defaults to https://ao.api.observatory.academy
# See configuration.py for a list of all supported configuration parameters.
configuration = academic_observatory_api.client.Configuration(
host = "https://ao.api.observatory.academy"
)
# 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 API key authorization: api_key
configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'
# Enter a context with an instance of the API client
with academic_observatory_api.client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = academic_observatory_api.AcademicObservatoryApi(api_client)
agg = "author" # str | The aggregate.
subagg = "access-types" # str | The sub-aggregate.
agg_id = [
"agg_id_example",
] # [str] | Filter on aggregates with this id, if multiple values are given the results are filtered on whether there are aggregates with one of the given values. (optional)
subagg_id = [
"subagg_id_example",
] # [str] | Filter on subaggregates with this id, if multiple values are given the results are filtered on whether there are subaggregates with one of the given values. (optional)
index_date = dateutil_parser('1970-01-01').date() # date | Index date, defaults to latest (optional)
_from = dateutil_parser('1970-01-01').date() # date | Start year (included) (optional)
to = dateutil_parser('1970-01-01').date() # date | End year (included) (optional)
limit = 1 # int | Limit number of results (max 10000) (optional)
search_after = "search_after_example" # str | The sort value of the last item from the previous search, used to paginate. The results are sorted by _shard_doc when a PIT is used and by document id (_id) without a PIT. (optional)
pit = "pit_example" # str | The pit id (optional)
pretty = True # bool | If true, the endpoint returns only the user metadata. (optional)
# example passing only required values which don't have defaults set
try:
api_response = api_instance.query_subagg(agg, subagg)
pprint(api_response)
except academic_observatory_api.client.ApiException as e:
print("Exception when calling AcademicObservatoryApi->query_subagg: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.query_subagg(agg, subagg, agg_id=agg_id, subagg_id=subagg_id, index_date=index_date, _from=_from, to=to, limit=limit, search_after=search_after, pit=pit, pretty=pretty)
pprint(api_response)
except academic_observatory_api.client.ApiException as e:
print("Exception when calling AcademicObservatoryApi->query_subagg: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| agg | str | The aggregate. | |
| subagg | str | The sub-aggregate. | |
| agg_id | [str] | Filter on aggregates with this id, if multiple values are given the results are filtered on whether there are aggregates with one of the given values. | [optional] |
| subagg_id | [str] | Filter on subaggregates with this id, if multiple values are given the results are filtered on whether there are subaggregates with one of the given values. | [optional] |
| index_date | date | Index date, defaults to latest | [optional] |
| _from | date | Start year (included) | [optional] |
| to | date | End year (included) | [optional] |
| limit | int | Limit number of results (max 10000) | [optional] |
| search_after | str | The sort value of the last item from the previous search, used to paginate. The results are sorted by _shard_doc when a PIT is used and by document id (_id) without a PIT. | [optional] |
| pit | str | The pit id | [optional] |
| pretty | bool | If true, the endpoint returns only the user metadata. | [optional] |
Return type¶
HTTP request headers¶
Content-Type: Not defined
Accept: application/json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully return query results | - |
| 401 | API key is missing or invalid | * WWW_Authenticate - |