You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Onlyfansapi Python library provides convenient access to the Onlyfansapi REST API from any Python 3.9+
6
+
The Only Fans API Python library provides convenient access to the Only Fans API REST API from any Python 3.9+
7
7
application. The library includes type definitions for all request params and response fields,
8
8
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
9
9
10
10
It is generated with [Stainless](https://www.stainless.com/).
11
11
12
12
## Documentation
13
13
14
-
The full API of this library can be found in [api.md](api.md).
14
+
The REST API documentation can be found on [docs.onlyfansapi.com](https://docs.onlyfansapi.com). The full API of this library can be found in [api.md](api.md).
15
15
16
16
## Installation
17
17
@@ -29,9 +29,9 @@ The full API of this library can be found in [api.md](api.md).
29
29
30
30
```python
31
31
import os
32
-
from onlyfansapi importOnlyfansapi
32
+
from onlyfansapi importOnlyFansAPI
33
33
34
-
client =Onlyfansapi(
34
+
client =OnlyFansAPI(
35
35
api_key=os.environ.get("ONLYFANSAPI_API_KEY"), # This is the default and can be omitted
36
36
)
37
37
@@ -46,14 +46,14 @@ so that your API Key is not stored in source control.
46
46
47
47
## Async usage
48
48
49
-
Simply import `AsyncOnlyfansapi` instead of `Onlyfansapi` and use `await` with each API call:
49
+
Simply import `AsyncOnlyFansAPI` instead of `OnlyFansAPI` and use `await` with each API call:
50
50
51
51
```python
52
52
import os
53
53
import asyncio
54
-
from onlyfansapi importAsyncOnlyfansapi
54
+
from onlyfansapi importAsyncOnlyFansAPI
55
55
56
-
client =AsyncOnlyfansapi(
56
+
client =AsyncOnlyFansAPI(
57
57
api_key=os.environ.get("ONLYFANSAPI_API_KEY"), # This is the default and can be omitted
58
58
)
59
59
@@ -85,11 +85,11 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
85
85
import os
86
86
import asyncio
87
87
from onlyfansapi import DefaultAioHttpClient
88
-
from onlyfansapi importAsyncOnlyfansapi
88
+
from onlyfansapi importAsyncOnlyFansAPI
89
89
90
90
91
91
asyncdefmain() -> None:
92
-
asyncwithAsyncOnlyfansapi(
92
+
asyncwithAsyncOnlyFansAPI(
93
93
api_key=os.environ.get("ONLYFANSAPI_API_KEY"), # This is the default and can be omitted
94
94
http_client=DefaultAioHttpClient(),
95
95
) as client:
@@ -114,14 +114,22 @@ Typed requests and responses provide autocomplete and documentation within your
114
114
Nested parameters are dictionaries, typed using `TypedDict`, for example:
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
0 commit comments