Skip to content

Commit 10052a8

Browse files
committed
Initial Commit
0 parents  commit 10052a8

File tree

3 files changed

+165
-0
lines changed

3 files changed

+165
-0
lines changed

LICENSE

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

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# threads-openapi 🧵
2+
3+
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
4+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/yourusername/threads-api-openapi/pulls)
5+
6+
The unofficial API for Threads. This repository contains the OpenAPI YAML file that documents the reverse-engineered APIs currently available for Threads. This project is inspired by [junhoyeo/threads-api](https://github.com/junhoyeo/threads-api).
7+
8+
Note that it's a reverse-engineered api, and it requires extra effort to use this api, like handling tokens for authentication. For more informations, checkout [here](https://github.com/junhoyeo/threads-api/blob/main/threads-api/src/threads-api.ts). I recommend you to use ChatGPT for better understanding of Threads API.
9+
10+
## 🧩 OpenAPI Code Generators
11+
12+
To accelerate your development process, we recommend using OpenAPI code generators. These tools can help you generate client libraries, server stubs, and API documentation based on the OpenAPI specification.
13+
14+
Here are a few popular OpenAPI code generators you can use:
15+
16+
- [OpenAPI Generator](https://openapi-generator.tech/)
17+
- [Swagger Codegen](https://swagger.io/tools/swagger-codegen/)
18+
- [NSwag](https://github.com/RicoSuter/NSwag)
19+
20+
Choose the code generator that best fits your development environment and requirements. Refer to their respective documentation for installation and usage instructions.
21+
22+
## 🤝 Contributing
23+
24+
Contributions are welcome! If you encounter any issues or have ideas for improvements, feel free to open an issue or submit a pull request. Please check the [contribution guidelines](CONTRIBUTING.md) before making any contributions.
25+
26+
## 📝 License
27+
28+
This project is licensed under the [MIT License](LICENSE).
29+
30+
---
31+
32+
🌟 Don't forget to star this repository if you find it useful! 🌟

openapi.yaml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
openapi: 3.0.0
2+
info:
3+
title: Threads API
4+
version: 1.0.0
5+
servers:
6+
- url: 'https://www.threads.net'
7+
paths:
8+
/api/graphql/getUserProfile:
9+
post:
10+
operationId: getUserProfile
11+
parameters:
12+
- name: username
13+
in: header
14+
required: true
15+
schema:
16+
type: string
17+
- name: userId
18+
in: header
19+
required: true
20+
schema:
21+
type: string
22+
responses:
23+
'200':
24+
description: A ThreadsUser object
25+
content:
26+
application/json:
27+
schema:
28+
$ref: '#/components/schemas/GetUserProfileResponse'
29+
/api/graphql/getUserProfileThreads:
30+
post:
31+
operationId: getUserProfileThreads
32+
parameters:
33+
- name: username
34+
in: header
35+
required: true
36+
schema:
37+
type: string
38+
- name: userId
39+
in: header
40+
required: true
41+
schema:
42+
type: string
43+
responses:
44+
'200':
45+
description: An array of Thread objects
46+
content:
47+
application/json:
48+
schema:
49+
$ref: '#/components/schemas/GetUserProfileThreadsResponse'
50+
/api/graphql/getUserProfileReplies:
51+
post:
52+
operationId: getUserProfileReplies
53+
parameters:
54+
- name: username
55+
in: header
56+
required: true
57+
schema:
58+
type: string
59+
- name: userId
60+
in: header
61+
required: true
62+
schema:
63+
type: string
64+
responses:
65+
'200':
66+
description: An array of Thread objects
67+
content:
68+
application/json:
69+
schema:
70+
$ref: '#/components/schemas/GetUserProfileRepliesResponse'
71+
components:
72+
schemas:
73+
GetUserProfileResponse:
74+
type: object
75+
properties:
76+
data:
77+
type: object
78+
properties:
79+
userData:
80+
type: object
81+
properties:
82+
user:
83+
$ref: '#/components/schemas/ThreadsUser'
84+
extensions:
85+
$ref: '#/components/schemas/Extensions'
86+
GetUserProfileThreadsResponse:
87+
type: object
88+
properties:
89+
data:
90+
type: object
91+
properties:
92+
mediaData:
93+
type: object
94+
properties:
95+
threads:
96+
type: array
97+
items:
98+
$ref: '#/components/schemas/Thread'
99+
extensions:
100+
$ref: '#/components/schemas/Extensions'
101+
GetUserProfileRepliesResponse:
102+
type: object
103+
properties:
104+
data:
105+
type: object
106+
properties:
107+
mediaData:
108+
type: object
109+
properties:
110+
threads:
111+
type: array
112+
items:
113+
$ref: '#/components/schemas/Thread'
114+
extensions:
115+
$ref: '#/components/schemas/Extensions'
116+
Extensions:
117+
type: object
118+
description: Extensions object
119+
ThreadsUser:
120+
type: object
121+
description: ThreadsUser object
122+
Thread:
123+
type: object
124+
description: Thread object

0 commit comments

Comments
 (0)