abdnh/nadeshiko-api-client-openapi
Autogenerated Python API client for Nadeshiko (https://nadeshiko.co)
nadeshiko-api-client
Welcome to the Nadeshiko API.
Getting Started
Nadeshiko uses API keys to grant access to the API. Authentication is performed using the Authorization header. Please note that you must be registered on Nadeshiko to generate an API key. If you haven't registered yet, please do so.
If you haven't generated an API key yet, you can do so on your account page, API section.
Quotas and Limits
The API has a rate limit to ensure fair usage. Each API key is subject to a rate limit of 2000 requests per 5 minutes. Exceeding this limit will result in a temporary block with the following message:
"Too many requests. Please try again later."
Additionally, each account has a monthly quota limit based on the user's roles. Once the monthly quota is exceeded, the API key will be temporarily disabled for the rest of the month, and any further requests will receive the message:
"API Key quota exceeded for this month."
| Role | Quota (Monthly) |
|---|---|
| Normal User | 5000 requests |
To increase your quota, please contact the Nadeshiko team. For more information, refer to the contact page.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 1.0.0
- Generator version: 7.18.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit https://scalar.com
Requirements.
Python 3.9+
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/abdnh/nadeshiko-api-client.git(you may need to run pip with root permission: sudo pip install git+https://github.com/abdnh/nadeshiko-api-client.git)
Then import the package:
import nadeshiko_api_clientSetuptools
Install via Setuptools.
python setup.py install --user(or sudo python setup.py install to install the package for all users)
Then import the package:
import nadeshiko_api_clientTests
Execute pytest to run the tests.
Getting Started
Please follow the installation procedure and then run the following:
import nadeshiko_api_client
from nadeshiko_api_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.brigadasos.xyz/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = nadeshiko_api_client.Configuration(
host = "https://api.brigadasos.xyz/api/v1"
)
# 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'
# Enter a context with an instance of the API client
with nadeshiko_api_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = nadeshiko_api_client.SearchApi(api_client)
context_request = nadeshiko_api_client.ContextRequest() # ContextRequest |
try:
# Get context for a sentence
api_response = api_instance.get_context_sentence(context_request)
print("The response of SearchApi->get_context_sentence:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling SearchApi->get_context_sentence: %s\n" % e)Documentation for API Endpoints
All URIs are relative to https://api.brigadasos.xyz/api/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| SearchApi | get_context_sentence | POST /search/media/context | Get context for a sentence |
| SearchApi | get_recent_media | GET /search/media/info | Get recent media |
| SearchApi | search_multiple_words | POST /search/media/match/words | Search by multiple queries |
| SearchApi | search_sentence | POST /search/media/sentence | Search by query |
Documentation For Models
- BasicInfo
- CategoryStatistic
- ContextRequest
- MediaInfo
- ResponseV1
- SearchMultipleWordsRequest
- SegmentInfo
- Sentence
- SentenceSearchRequest
- Statistic
Documentation For Authorization
Authentication schemes defined for the API:
apiKeyHeader
- Type: API key
- API key parameter name: X-API-Key
- Location: HTTP header