{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"],"fields":{"title":{"boost":1000.0},"text":{"boost":1.0},"tags":{"boost":1000000.0}}},"docs":[{"location":"","title":"Kwork API Documentation","text":"

Unofficial Python client for Kwork.ru API.

"},{"location":"#quick-start","title":"Quick Start","text":""},{"location":"#installation","title":"Installation","text":"
pip install kwork-api\n
"},{"location":"#authentication","title":"Authentication","text":"
from kwork_api import KworkClient\n\n# Login with credentials\nclient = await KworkClient.login(\"username\", \"password\")\n\n# Or restore from token\nclient = KworkClient(token=\"your_web_auth_token\")\n
"},{"location":"#basic-usage","title":"Basic Usage","text":"
async with KworkClient(token=\"token\") as client:\n    # Get catalog\n    catalog = await client.catalog.get_list(page=1)\n\n    # Get kwork details\n    details = await client.catalog.get_details(kwork_id=123)\n\n    # Get projects\n    projects = await client.projects.get_list()\n
"},{"location":"#documentation-sections","title":"Documentation Sections","text":""},{"location":"#features","title":"Features","text":""},{"location":"#rate-limiting","title":"Rate Limiting","text":"

Rate limiting is not implemented in the library. Handle it in your code:

import asyncio\n\nfor page in range(1, 10):\n    catalog = await client.catalog.get_list(page=page)\n    await asyncio.sleep(1)  # 1 second delay\n
"},{"location":"#error-handling","title":"Error Handling","text":"
from kwork_api import KworkAuthError, KworkApiError\n\ntry:\n    catalog = await client.catalog.get_list()\nexcept KworkAuthError as e:\n    print(f\"Auth failed: {e}\")\nexcept KworkApiError as e:\n    print(f\"API error [{e.status_code}]: {e.message}\")\n

Documentation auto-generated from source code.

"},{"location":"api-reference/","title":"API Reference","text":"

Auto-generated API documentation.

Last updated: kwork-api

"},{"location":"api-reference/#kworkclient","title":"KworkClient","text":"

Kwork.ru API client.

Usage: # Login with credentials client = await KworkClient.login(\"username\", \"password\")

# Or restore from token\nclient = KworkClient(token=\"your_web_auth_token\")\n\n# Make requests\ncatalog = await client.catalog.get_list(page=1)\n
"},{"location":"api-reference/#methods","title":"Methods","text":""},{"location":"api-reference/#catalog","title":"catalog()","text":"

Catalog API.

"},{"location":"api-reference/#projects","title":"projects()","text":"

Projects API.

"},{"location":"api-reference/#user","title":"user()","text":"

User API.

"},{"location":"api-reference/#reference","title":"reference()","text":"

Reference data API.

"},{"location":"api-reference/#notifications","title":"notifications()","text":"

Notifications API.

"},{"location":"api-reference/#other","title":"other()","text":"

Other endpoints.

"},{"location":"api-reference/#catalogapi","title":"CatalogAPI","text":"

Catalog/Kworks API endpoints.

"},{"location":"api-reference/#projectsapi","title":"ProjectsAPI","text":"

Projects (freelance orders) API endpoints.

"},{"location":"api-reference/#userapi","title":"UserAPI","text":"

User API endpoints.

"},{"location":"api-reference/#referenceapi","title":"ReferenceAPI","text":"

Reference data (cities, countries, etc.) endpoints.

"},{"location":"api-reference/#notificationsapi","title":"NotificationsAPI","text":"

Notifications and messages endpoints.

"},{"location":"api-reference/#otherapi","title":"OtherAPI","text":"

Other API endpoints.

"},{"location":"api-reference/#models","title":"Models","text":"

Pydantic models used in API responses.

"},{"location":"api-reference/#kworkuser","title":"KworkUser","text":"

User information.

"},{"location":"api-reference/#fields","title":"Fields","text":"Field Type Description id - - username - - avatar_url - - is_online - - rating - -"},{"location":"api-reference/#kworkcategory","title":"KworkCategory","text":"

Category information.

"},{"location":"api-reference/#fields_1","title":"Fields","text":"Field Type Description id - - name - - slug - - parent_id - -"},{"location":"api-reference/#kwork","title":"Kwork","text":"

Kwork (service) information.

"},{"location":"api-reference/#fields_2","title":"Fields","text":"Field Type Description id - - title - - description - - price - - currency - - category_id - - seller - - images - - rating - - reviews_count - - created_at - - updated_at - -"},{"location":"api-reference/#kworkdetails","title":"KworkDetails","text":"

Extended kwork details.

"},{"location":"api-reference/#fields_3","title":"Fields","text":"Field Type Description full_description - - requirements - - delivery_time - - revisions - - features - - faq - -"},{"location":"api-reference/#paginationinfo","title":"PaginationInfo","text":"

Pagination metadata.

"},{"location":"api-reference/#fields_4","title":"Fields","text":"Field Type Description current_page - - total_pages - - total_items - - items_per_page - - has_next - - has_prev - -"},{"location":"api-reference/#catalogresponse","title":"CatalogResponse","text":"

Catalog response with kworks and pagination.

"},{"location":"api-reference/#fields_5","title":"Fields","text":"Field Type Description kworks - - pagination - - filters - - sort_options - -"},{"location":"api-reference/#project","title":"Project","text":"

Project (freelance order) information.

"},{"location":"api-reference/#fields_6","title":"Fields","text":"Field Type Description id - - title - - description - - budget - - budget_type - - category_id - - customer - - status - - created_at - - updated_at - - bids_count - - skills - -"},{"location":"api-reference/#projectsresponse","title":"ProjectsResponse","text":"

Projects list response.

"},{"location":"api-reference/#fields_7","title":"Fields","text":"Field Type Description projects - - pagination - -"},{"location":"api-reference/#review","title":"Review","text":"

Review information.

"},{"location":"api-reference/#fields_8","title":"Fields","text":"Field Type Description id - - rating - - comment - - author - - kwork_id - - created_at - -"},{"location":"api-reference/#reviewsresponse","title":"ReviewsResponse","text":"

Reviews list response.

"},{"location":"api-reference/#fields_9","title":"Fields","text":"Field Type Description reviews - - pagination - - average_rating - -"},{"location":"api-reference/#notification","title":"Notification","text":"

Notification information.

"},{"location":"api-reference/#fields_10","title":"Fields","text":"Field Type Description id - - type - - title - - message - - is_read - - created_at - - link - -"},{"location":"api-reference/#notificationsresponse","title":"NotificationsResponse","text":"

Notifications list response.

"},{"location":"api-reference/#fields_11","title":"Fields","text":"Field Type Description notifications - - unread_count - -"},{"location":"api-reference/#dialog","title":"Dialog","text":"

Dialog (chat) information.

"},{"location":"api-reference/#fields_12","title":"Fields","text":"Field Type Description id - - participant - - last_message - - unread_count - - updated_at - -"},{"location":"api-reference/#authresponse","title":"AuthResponse","text":"

Authentication response.

"},{"location":"api-reference/#fields_13","title":"Fields","text":"Field Type Description success - - user_id - - username - - web_auth_token - - message - -"},{"location":"api-reference/#errordetail","title":"ErrorDetail","text":"

Error detail from API.

"},{"location":"api-reference/#fields_14","title":"Fields","text":"Field Type Description code - - message - - field - -"},{"location":"api-reference/#apierrorresponse","title":"APIErrorResponse","text":"

Standard API error response.

"},{"location":"api-reference/#fields_15","title":"Fields","text":"Field Type Description success - - errors - - message - -"},{"location":"api-reference/#city","title":"City","text":"

City information.

"},{"location":"api-reference/#fields_16","title":"Fields","text":"Field Type Description id - - name - - country_id - -"},{"location":"api-reference/#country","title":"Country","text":"

Country information.

"},{"location":"api-reference/#fields_17","title":"Fields","text":"Field Type Description id - - name - - code - - cities - -"},{"location":"api-reference/#timezone","title":"TimeZone","text":"

Timezone information.

"},{"location":"api-reference/#fields_18","title":"Fields","text":"Field Type Description id - - name - - offset - -"},{"location":"api-reference/#feature","title":"Feature","text":"

Feature/addon information.

"},{"location":"api-reference/#fields_19","title":"Fields","text":"Field Type Description id - - name - - description - - price - - type - -"},{"location":"api-reference/#badge","title":"Badge","text":"

User badge information.

"},{"location":"api-reference/#fields_20","title":"Fields","text":"Field Type Description id - - name - - description - - icon_url - -"},{"location":"api-reference/#dataresponse","title":"DataResponse","text":"

Generic data response wrapper.

"},{"location":"api-reference/#fields_21","title":"Fields","text":"Field Type Description success - - data - - message - -"},{"location":"api-reference/#errors","title":"Errors","text":"

Exception classes for error handling.

"},{"location":"api-reference/#kworkerror","title":"KworkError","text":"

Base exception for all Kwork API errors.

"},{"location":"api-reference/#kworkautherror","title":"KworkAuthError","text":"

Authentication/authorization error.

"},{"location":"api-reference/#kworkapierror","title":"KworkApiError","text":"

API request error (4xx, 5xx).

"},{"location":"api-reference/#kworknotfounderror","title":"KworkNotFoundError","text":"

Resource not found (404).

"},{"location":"api-reference/#kworkratelimiterror","title":"KworkRateLimitError","text":"

Rate limit exceeded (429).

"},{"location":"api-reference/#kworkvalidationerror","title":"KworkValidationError","text":"

Validation error (400).

"},{"location":"api-reference/#kworknetworkerror","title":"KworkNetworkError","text":"

Network/connection error.

"},{"location":"examples/","title":"Usage Examples","text":""},{"location":"examples/#catalog","title":"Catalog","text":""},{"location":"examples/#get-catalog-list","title":"Get Catalog List","text":"
from kwork_api import KworkClient\n\nasync with KworkClient(token=\"token\") as client:\n    catalog = await client.catalog.get_list(page=1, category_id=5)\n\n    for kwork in catalog.kworks:\n        print(f\"{kwork.title}: {kwork.price} RUB\")\n\n    # Pagination\n    if catalog.pagination:\n        print(f\"Page {catalog.pagination.current_page} of {catalog.pagination.total_pages}\")\n
"},{"location":"examples/#get-kwork-details","title":"Get Kwork Details","text":"
details = await client.catalog.get_details(kwork_id=123)\n\nprint(f\"Title: {details.title}\")\nprint(f\"Price: {details.price}\")\nprint(f\"Description: {details.full_description}\")\nprint(f\"Delivery: {details.delivery_time} days\")\n
"},{"location":"examples/#projects","title":"Projects","text":""},{"location":"examples/#get-projects-list","title":"Get Projects List","text":"
projects = await client.projects.get_list(page=1)\n\nfor project in projects.projects:\n    print(f\"{project.title} - {project.budget} RUB\")\n
"},{"location":"examples/#get-customer-orders","title":"Get Customer Orders","text":"
orders = await client.projects.get_payer_orders()\n\nfor order in orders:\n    print(f\"Order #{order.id}: {order.status}\")\n
"},{"location":"examples/#get-performer-orders","title":"Get Performer Orders","text":"
orders = await client.projects.get_worker_orders()\n\nfor order in orders:\n    print(f\"Work #{order.id}: {order.status}\")\n
"},{"location":"examples/#user","title":"User","text":""},{"location":"examples/#get-user-info","title":"Get User Info","text":"
user_info = await client.user.get_info()\nprint(f\"Username: {user_info.get('username')}\")\n
"},{"location":"examples/#get-reviews","title":"Get Reviews","text":"
reviews = await client.user.get_reviews(page=1)\n\nfor review in reviews.reviews:\n    print(f\"Rating: {review.rating}/5 - {review.comment}\")\n
"},{"location":"examples/#get-favorite-kworks","title":"Get Favorite Kworks","text":"
favorites = await client.user.get_favorite_kworks()\n\nfor kwork in favorites:\n    print(f\"Favorite: {kwork.title}\")\n
"},{"location":"examples/#reference-data","title":"Reference Data","text":""},{"location":"examples/#get-cities","title":"Get Cities","text":"
cities = await client.reference.get_cities()\n\nfor city in cities:\n    print(f\"{city.id}: {city.name}\")\n
"},{"location":"examples/#get-countries","title":"Get Countries","text":"
countries = await client.reference.get_countries()\n\nfor country in countries:\n    print(f\"{country.id}: {country.name}\")\n
"},{"location":"examples/#get-timezones","title":"Get Timezones","text":"
timezones = await client.reference.get_timezones()\n\nfor tz in timezones:\n    print(f\"{tz.id}: {tz.name} ({tz.offset})\")\n
"},{"location":"examples/#notifications","title":"Notifications","text":""},{"location":"examples/#get-notifications","title":"Get Notifications","text":"
notifications = await client.notifications.get_list()\n\nfor notif in notifications.notifications:\n    print(f\"{notif.title}: {notif.message}\")\n\nprint(f\"Unread: {notifications.unread_count}\")\n
"},{"location":"examples/#fetch-new-notifications","title":"Fetch New Notifications","text":"
new_notifications = await client.notifications.fetch()\nprint(f\"New: {len(new_notifications.notifications)}\")\n
"},{"location":"examples/#get-dialogs","title":"Get Dialogs","text":"
dialogs = await client.notifications.get_dialogs()\n\nfor dialog in dialogs:\n    print(f\"Dialog with {dialog.participant.username}: {dialog.last_message}\")\n
"},{"location":"examples/#error-handling","title":"Error Handling","text":"
from kwork_api import KworkAuthError, KworkApiError, KworkNotFoundError\n\ntry:\n    catalog = await client.catalog.get_list()\nexcept KworkAuthError as e:\n    print(f\"Authentication failed: {e}\")\nexcept KworkNotFoundError as e:\n    print(f\"Resource not found: {e}\")\nexcept KworkApiError as e:\n    print(f\"API error [{e.status_code}]: {e.message}\")\nexcept Exception as e:\n    print(f\"Unexpected error: {e}\")\n
"},{"location":"examples/#rate-limiting","title":"Rate Limiting","text":"
import asyncio\n\nasync def fetch_all_pages():\n    all_kworks = []\n\n    for page in range(1, 10):\n        try:\n            catalog = await client.catalog.get_list(page=page)\n            all_kworks.extend(catalog.kworks)\n\n            if not catalog.pagination or not catalog.pagination.has_next:\n                break\n\n            # Delay to avoid rate limiting\n            await asyncio.sleep(1)\n\n        except KworkRateLimitError:\n            print(\"Rate limited, waiting...\")\n            await asyncio.sleep(5)\n\n    return all_kworks\n
"},{"location":"examples/#pagination-helper","title":"Pagination Helper","text":"
async def fetch_all_catalog():\n    \"\"\"Fetch all kworks from catalog with pagination.\"\"\"\n    all_kworks = []\n    page = 1\n\n    while True:\n        catalog = await client.catalog.get_list(page=page)\n        all_kworks.extend(catalog.kworks)\n\n        if not catalog.pagination or not catalog.pagination.has_next:\n            break\n\n        page += 1\n        await asyncio.sleep(0.5)  # Rate limiting\n\n    return all_kworks\n

More examples in the API Reference.

"}]}