miskibin / wykop

python api wrapper for wykop api V3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wykop API Client

This is a Python client library for accessing the Wykop API v3. It simplifies the process of making HTTP requests to the Wykop API and handles authentication and token management.

Getting Started

Before you can use this library, you need to obtain your API credentials (app key and secret) from Wykop.

Obtaining API Credentials

  1. Go to the Wykop Developer Dashboard: Wykop API Dashboard
  2. Create a new application if you haven't done so already.
  3. Note down the app_key and secret provided after the application registration process.

Installation

Install the package via pip:

pip install wykop

Usage

Here's how you can use the WykopAPI client in your Python projects:

Importing the library

from wykop import WykopAPI

Initializing the client

To start making requests to the Wykop API, you need to instantiate the client with your credentials:

api = WykopAPI(app_key='your_app_key', secret='your_secret')

Authenticating

To perform authenticated requests, first call the authenticate method:

api.authenticate()

Making requests

After authenticating, you can make requests to the API. For example, to fetch data from a specific endpoint:

response = api.make_request('/some_endpoint', method='GET')
print(response)

Closing the client

It's important to close the HTTP client when you're done:

api.close()

Example

Here is a full example of using the Wykop API client:

def main():
    app_key = 'your_app_key'
    secret = 'your_secret'
    api = WykopAPI(app_key, secret)
    try:
        api.authenticate()
        response = api.make_request('/tags/popular-user-tags', method='GET')
        print(response)
    finally:
        api.close()

if __name__ == "__main__":
    main()

output

{'data': [{'name': 'misteriusowybot'}, {'name': 'kuponynazywo'}, {'name': 'gearbestkupony'},
{'name': 'anonimowemirkowyznania'}, {'name': 'mirkoanonim'}, {'name': 'chinskacebulakupony'},
{'name': 'pustulkowelaptopy'}, {'name': 'grzewczy'}, {'name': 'otwartywykopmobilny'}, 
{'name': 'lowcychin'}]}

Support

For issues, questions, or contributions, please use the GitHub repository associated with this package.

About

python api wrapper for wykop api V3


Languages

Language:Jupyter Notebook 98.5%Language:Python 1.5%