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.
Before you can use this library, you need to obtain your API credentials (app key and secret) from Wykop.
- Go to the Wykop Developer Dashboard: Wykop API Dashboard
- Create a new application if you haven't done so already.
- Note down the
app_key
andsecret
provided after the application registration process.
Install the package via pip:
pip install wykop
Here's how you can use the WykopAPI
client in your Python projects:
from wykop import WykopAPI
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')
To perform authenticated requests, first call the authenticate
method:
api.authenticate()
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)
It's important to close the HTTP client when you're done:
api.close()
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()
{'data': [{'name': 'misteriusowybot'}, {'name': 'kuponynazywo'}, {'name': 'gearbestkupony'},
{'name': 'anonimowemirkowyznania'}, {'name': 'mirkoanonim'}, {'name': 'chinskacebulakupony'},
{'name': 'pustulkowelaptopy'}, {'name': 'grzewczy'}, {'name': 'otwartywykopmobilny'},
{'name': 'lowcychin'}]}
For issues, questions, or contributions, please use the GitHub repository associated with this package.