Skip to content

Commit ff49ce8

Browse files
author
Moldachev Sergey
committed
Initial release
0 parents  commit ff49ce8

23 files changed

Lines changed: 1162 additions & 0 deletions

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea
2+
build
3+
dist
4+
tokapi_client.egg-info

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Live Code Stream
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Pipfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[[source]]
2+
url = "https://pypi.python.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
httpx = "*"
8+
9+
[dev-packages]
10+
pytest = "*"
11+
12+
[requires]
13+
python_version = "3.9"

Pipfile.lock

Lines changed: 157 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!-- markdownlint-disable MD013 -->
2+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/mtokapi/tokapi-client/issues)
3+
<!-- markdownlint-enable MD013 -->
4+
5+
The simple http client for [TokApi](https://rapidapi.com/Sonjik/api/tokapi-mobile-version) tiktok mobile API
6+
7+
## Installation
8+
9+
```shell
10+
pip install tokapi-client
11+
```
12+
13+
## Usage
14+
15+
```shell
16+
api = TokApi('YOUR_RAPID_API_KEY')
17+
18+
# Let's find some users by search query with pagination
19+
keyword = 'nike'
20+
offset = 0
21+
for i in range(0, 3):
22+
result = api.search_user_by_keyword(keyword, offset=offset)
23+
data = result.json()
24+
25+
for user in data['user_list']:
26+
info = user['user_info']
27+
print('Nickname: {}, region: {}'.format(info['nickname'],
28+
info['region']))
29+
30+
offset = data['cursor']
31+
```
32+
33+
## Examples
34+
35+
You can find more complex usage examples in [examples](examples) folder
36+
37+
## Legal
38+
39+
This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by TikTok
40+
or any of its affiliates or subsidiaries. This is an independent and unofficial API. Use at your own risk.

0 commit comments

Comments
 (0)