# qoery
Qoetry API for dataset collection and management. Start dataset collection jobs,
monitor their progress, and download results as CSV files.

## Authentication

**All endpoints require API key authentication** (except `/health` and `/`).

You can provide your API key via:
- Query parameter: `?api_key=your_api_key`
- Header: `x-api-key: your_api_key`
- Header: `Authorization: Bearer your_api_key`

## Rate Limits

API calls are subject to monthly quotas based on your subscription plan.
Quota information is available via the `/v0/usage` endpoint.


This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 0.5.0
- Package version: 0.5.1
- Generator version: 7.14.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://qoery.com](https://qoery.com)

## Requirements.

Python 3.9+

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)

Then import the package:
```python
import qoery
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import qoery
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

import qoery
from qoery.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.qoery.com
# See configuration.py for a list of all supported configuration parameters.
configuration = qoery.Configuration(
    host = "https://api.qoery.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 API key authorization: ApiKeyHeader
configuration.api_key['ApiKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyHeader'] = 'Bearer'

# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'

# Configure Bearer authorization (API_KEY): BearerAuth
configuration = qoery.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with qoery.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = qoery.DatasetsApi(api_client)
    job_id = '20251110_151628' # str | Unique identifier for the job

    try:
        # Download the CSV file
        api_response = api_instance.download_dataset_csv(job_id)
        print("The response of DatasetsApi->download_dataset_csv:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DatasetsApi->download_dataset_csv: %s\n" % e)

```

## Documentation for API Endpoints

All URIs are relative to *https://api.qoery.com*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DatasetsApi* | [**download_dataset_csv**](docs/DatasetsApi.md#download_dataset_csv) | **GET** /v0/datasets/{job_id}/csv | Download the CSV file
*DatasetsApi* | [**get_dataset_job_status**](docs/DatasetsApi.md#get_dataset_job_status) | **GET** /v0/datasets/{job_id} | Get job status and progress
*DatasetsApi* | [**list_datasets_or_start_job**](docs/DatasetsApi.md#list_datasets_or_start_job) | **GET** /v0/datasets | List API endpoints or start a dataset collection job
*DatasetsApi* | [**start_dataset_job**](docs/DatasetsApi.md#start_dataset_job) | **POST** /v0/datasets | Start a new dataset collection job
*HealthApi* | [**health_check**](docs/HealthApi.md#health_check) | **GET** /health | Health Check
*HealthApi* | [**root_status**](docs/HealthApi.md#root_status) | **GET** / | Root Status
*PlansApi* | [**list_plans**](docs/PlansApi.md#list_plans) | **GET** /v0/plans | List subscription plans and endpoint limits
*UsageApi* | [**get_usage_stats**](docs/UsageApi.md#get_usage_stats) | **GET** /v0/usage | Get usage statistics


## Documentation For Models

 - [ApiInfo](docs/ApiInfo.md)
 - [EndpointUsage](docs/EndpointUsage.md)
 - [ErrorResponse](docs/ErrorResponse.md)
 - [GetDatasetJobStatus200Response](docs/GetDatasetJobStatus200Response.md)
 - [GetDatasetJobStatus200ResponseProgress](docs/GetDatasetJobStatus200ResponseProgress.md)
 - [GetUsageStats200Response](docs/GetUsageStats200Response.md)
 - [GetUsageStats200ResponseEndpointBreakdownInner](docs/GetUsageStats200ResponseEndpointBreakdownInner.md)
 - [HealthResponse](docs/HealthResponse.md)
 - [JobProgress](docs/JobProgress.md)
 - [JobStartRequest](docs/JobStartRequest.md)
 - [JobStartResponse](docs/JobStartResponse.md)
 - [JobStatus](docs/JobStatus.md)
 - [ListDatasetsOrStartJob200Response](docs/ListDatasetsOrStartJob200Response.md)
 - [ListDatasetsOrStartJob200ResponseOneOf](docs/ListDatasetsOrStartJob200ResponseOneOf.md)
 - [ListDatasetsOrStartJob200ResponseOneOf1](docs/ListDatasetsOrStartJob200ResponseOneOf1.md)
 - [ListDatasetsOrStartJob400Response](docs/ListDatasetsOrStartJob400Response.md)
 - [ListDatasetsOrStartJob429Response](docs/ListDatasetsOrStartJob429Response.md)
 - [ListPlans200Response](docs/ListPlans200Response.md)
 - [ListPlans200ResponsePlansValue](docs/ListPlans200ResponsePlansValue.md)
 - [ListPlans200ResponsePlansValueAnnualPrice](docs/ListPlans200ResponsePlansValueAnnualPrice.md)
 - [ListPlans200ResponsePlansValueApiKeys](docs/ListPlans200ResponsePlansValueApiKeys.md)
 - [ListPlans200ResponsePlansValueMonthlyPrice](docs/ListPlans200ResponsePlansValueMonthlyPrice.md)
 - [Plan](docs/Plan.md)
 - [PlanPrice](docs/PlanPrice.md)
 - [PlansResponse](docs/PlansResponse.md)
 - [RootStatus200Response](docs/RootStatus200Response.md)
 - [StartDatasetJobRequest](docs/StartDatasetJobRequest.md)
 - [UsageStats](docs/UsageStats.md)


<a id="documentation-for-authorization"></a>
## Documentation For Authorization


Authentication schemes defined for the API:
<a id="ApiKeyAuth"></a>
### ApiKeyAuth

- **Type**: API key
- **API key parameter name**: api_key
- **Location**: URL query string

<a id="ApiKeyHeader"></a>
### ApiKeyHeader

- **Type**: API key
- **API key parameter name**: x-api-key
- **Location**: HTTP header

<a id="BearerAuth"></a>
### BearerAuth

- **Type**: Bearer authentication (API_KEY)


## Author

samuel.tinnerholm@gmail.com


