Skip to content

Commit e89ce9e

Browse files
feat(api): manual updates
1 parent 816e6f5 commit e89ce9e

444 files changed

Lines changed: 57554 additions & 2031 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 117
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/onlyfansapi/onlyfansapi-b22aeea1216c7b1f4704f33cf7bf5ee5b908110194888ce4cc004228d05826cb.yml
1+
configured_endpoints: 265
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/onlyfansapi/onlyfansapi-03fa3b4bcb7366349018abcfc80d638bbbf01914ddaec6c316fa86d50668baf9.yml
33
openapi_spec_hash: d880cb4e4a8105f9bb48453cdd151fde
4-
config_hash: 6cf1fccaec2576a6c035f5fe09e30838
4+
config_hash: af5f7bc4785bef767bfc36504cb43554

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2026 Onlyfansapi
189+
Copyright 2026 Only Fans API
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Onlyfansapi Python API library
1+
# Only Fans API Python API library
22

33
<!-- prettier-ignore -->
44
[![PyPI version](https://img.shields.io/pypi/v/onlyfansapi.svg?label=pypi%20(stable))](https://pypi.org/project/onlyfansapi/)
55

6-
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+
77
application. The library includes type definitions for all request params and response fields,
88
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
99

1010
It is generated with [Stainless](https://www.stainless.com/).
1111

1212
## Documentation
1313

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).
1515

1616
## Installation
1717

@@ -29,9 +29,9 @@ The full API of this library can be found in [api.md](api.md).
2929

3030
```python
3131
import os
32-
from onlyfansapi import Onlyfansapi
32+
from onlyfansapi import OnlyFansAPI
3333

34-
client = Onlyfansapi(
34+
client = OnlyFansAPI(
3535
api_key=os.environ.get("ONLYFANSAPI_API_KEY"), # This is the default and can be omitted
3636
)
3737

@@ -46,14 +46,14 @@ so that your API Key is not stored in source control.
4646

4747
## Async usage
4848

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:
5050

5151
```python
5252
import os
5353
import asyncio
54-
from onlyfansapi import AsyncOnlyfansapi
54+
from onlyfansapi import AsyncOnlyFansAPI
5555

56-
client = AsyncOnlyfansapi(
56+
client = AsyncOnlyFansAPI(
5757
api_key=os.environ.get("ONLYFANSAPI_API_KEY"), # This is the default and can be omitted
5858
)
5959

@@ -85,11 +85,11 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
8585
import os
8686
import asyncio
8787
from onlyfansapi import DefaultAioHttpClient
88-
from onlyfansapi import AsyncOnlyfansapi
88+
from onlyfansapi import AsyncOnlyFansAPI
8989

9090

9191
async def main() -> None:
92-
async with AsyncOnlyfansapi(
92+
async with AsyncOnlyFansAPI(
9393
api_key=os.environ.get("ONLYFANSAPI_API_KEY"), # This is the default and can be omitted
9494
http_client=DefaultAioHttpClient(),
9595
) as client:
@@ -114,14 +114,22 @@ Typed requests and responses provide autocomplete and documentation within your
114114
Nested parameters are dictionaries, typed using `TypedDict`, for example:
115115

116116
```python
117-
from onlyfansapi import Onlyfansapi
118-
119-
client = Onlyfansapi()
120-
121-
response = client.authenticate.start(
122-
custom_proxy={},
117+
from onlyfansapi import OnlyFansAPI
118+
119+
client = OnlyFansAPI()
120+
121+
response = client.analytics.summary.get_period_comparison(
122+
account_ids=["acc_abc123", "acc_def456"],
123+
period_a={
124+
"end": "2024-03-31",
125+
"start": "2024-01-01",
126+
},
127+
period_b={
128+
"end": "2024-06-30",
129+
"start": "2024-04-01",
130+
},
123131
)
124-
print(response.custom_proxy)
132+
print(response.period_a)
125133
```
126134

127135
## File uploads
@@ -130,9 +138,9 @@ Request parameters that correspond to file uploads can be passed as `bytes`, or
130138

131139
```python
132140
from pathlib import Path
133-
from onlyfansapi import Onlyfansapi
141+
from onlyfansapi import OnlyFansAPI
134142

135-
client = Onlyfansapi()
143+
client = OnlyFansAPI()
136144

137145
client.media.upload(
138146
account="acct_XXXXXXXXXXXXXXX",
@@ -153,9 +161,9 @@ All errors inherit from `onlyfansapi.APIError`.
153161

154162
```python
155163
import onlyfansapi
156-
from onlyfansapi import Onlyfansapi
164+
from onlyfansapi import OnlyFansAPI
157165

158-
client = Onlyfansapi()
166+
client = OnlyFansAPI()
159167

160168
try:
161169
client.whoami.retrieve()
@@ -192,10 +200,10 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
192200
You can use the `max_retries` option to configure or disable retry settings:
193201

194202
```python
195-
from onlyfansapi import Onlyfansapi
203+
from onlyfansapi import OnlyFansAPI
196204

197205
# Configure the default for all requests:
198-
client = Onlyfansapi(
206+
client = OnlyFansAPI(
199207
# default is 2
200208
max_retries=0,
201209
)
@@ -210,16 +218,16 @@ By default requests time out after 1 minute. You can configure this with a `time
210218
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
211219

212220
```python
213-
from onlyfansapi import Onlyfansapi
221+
from onlyfansapi import OnlyFansAPI
214222

215223
# Configure the default for all requests:
216-
client = Onlyfansapi(
224+
client = OnlyFansAPI(
217225
# 20 seconds (default is 1 minute)
218226
timeout=20.0,
219227
)
220228

221229
# More granular control:
222-
client = Onlyfansapi(
230+
client = OnlyFansAPI(
223231
timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
224232
)
225233

@@ -237,10 +245,10 @@ Note that requests that time out are [retried twice by default](#retries).
237245

238246
We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
239247

240-
You can enable logging by setting the environment variable `ONLYFANSAPI_LOG` to `info`.
248+
You can enable logging by setting the environment variable `ONLY_FANS_API_LOG` to `info`.
241249

242250
```shell
243-
$ export ONLYFANSAPI_LOG=info
251+
$ export ONLY_FANS_API_LOG=info
244252
```
245253

246254
Or to `debug` for more verbose logging.
@@ -262,9 +270,9 @@ if response.my_field is None:
262270
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
263271

264272
```py
265-
from onlyfansapi import Onlyfansapi
273+
from onlyfansapi import OnlyFansAPI
266274

267-
client = Onlyfansapi()
275+
client = OnlyFansAPI()
268276
response = client.whoami.with_raw_response.retrieve()
269277
print(response.headers.get('X-My-Header'))
270278

@@ -336,10 +344,10 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
336344

337345
```python
338346
import httpx
339-
from onlyfansapi import Onlyfansapi, DefaultHttpxClient
347+
from onlyfansapi import OnlyFansAPI, DefaultHttpxClient
340348

341-
client = Onlyfansapi(
342-
# Or use the `ONLYFANSAPI_BASE_URL` env var
349+
client = OnlyFansAPI(
350+
# Or use the `ONLY_FANS_API_BASE_URL` env var
343351
base_url="http://my.test.server.example.com:8083",
344352
http_client=DefaultHttpxClient(
345353
proxy="http://my.test.proxy.example.com",
@@ -359,9 +367,9 @@ client.with_options(http_client=DefaultHttpxClient(...))
359367
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.
360368

361369
```py
362-
from onlyfansapi import Onlyfansapi
370+
from onlyfansapi import OnlyFansAPI
363371

364-
with Onlyfansapi() as client:
372+
with OnlyFansAPI() as client:
365373
# make requests here
366374
...
367375

SECURITY.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Onlyfansapi, please follow the respective company's security reporting guidelines.
19+
or products provided by Only Fans API, please follow the respective company's security reporting guidelines.
20+
21+
### Only Fans API Terms and Policies
22+
23+
Please contact hello@onlyfansapi.com for any questions or concerns regarding the security of our services.
2024

2125
---
2226

0 commit comments

Comments
 (0)