https://github.com/arthurkushman/tiktok-api
TikTok api sdk for simple video embedding
https://github.com/arthurkushman/tiktok-api
api golang sdk sdk-go tiktok
Last synced: over 1 year ago
JSON representation
TikTok api sdk for simple video embedding
- Host: GitHub
- URL: https://github.com/arthurkushman/tiktok-api
- Owner: arthurkushman
- License: mit
- Created: 2020-01-08T08:39:24.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-07T20:49:41.000Z (about 5 years ago)
- Last Synced: 2025-04-09T23:07:50.807Z (over 1 year ago)
- Topics: api, golang, sdk, sdk-go, tiktok
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 13
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# tiktok-api
TikTok api sdk for simple video embedding
[](https://goreportcard.com/report/github.com/arthurkushman/tiktok-api)
[](https://godoc.org/github.com/arthurkushman/tiktok-api)
[](https://codecov.io/gh/arthurkushman/tiktok-api)
[](https://opensource.org/licenses/MIT)
### Installation
```go
go get -u github.com/arthurkushman/tiktok-api
```
### Usage
To get an embedded content of any video:
```go
tts := NewTikTokService()
resp, err := tts.Embed(map[string]string{
"url": "https://www.tiktok.com/@scout2015/video/6718335390845095173",
})
resp.Title // "Scramble up ur name & Iβll try to guess itπβ€οΈ #foryoupage #petsoftiktok #aesthetic"
resp.AuthorName // "Scout & Suki"
// and more props - see Response structure bellow
```
`resp` is a `Response` struct with all the fields filled-up e.g.:
```go
type Response struct {
Version: "1.0",
Type: "video",
Title: "Scramble up ur name & Iβll try to guess itπβ€οΈ #foryoupage #petsoftiktok #aesthetic",
AuthorUrl: "https://www.tiktok.com/@scout2015",
AuthorName: "Scout & Suki",
Width: "100%",
Height: "100%",
Html: "
@scout2015 Scramble up ur name & Iβll try to guess itπβ€οΈ #foryoupage #petsoftiktok #aesthetic
β¬ original sound - πππ°ππ’π’π
",
ThumbnailWidth: 720,
ThumbnailHeight: 1280,
ThumbnailUrl: "https://p16.muscdn.com/obj/tos-maliva-p-0068/06kv6rfcesljdjr45ukb0000d844090v0200010605",
ProviderUrl: "https://www.tiktok.com",
ProviderName: "TikTok"
}
```
It allows you to get the embed code and additional information about the video associated with the webpage link provided.