Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 2 months 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 (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-07T20:49:41.000Z (over 3 years ago)
- Last Synced: 2024-09-29T21:22:10.422Z (3 months ago)
- Topics: api, golang, sdk, sdk-go, tiktok
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 12
- Watchers: 4
- 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[![Go Report Card](https://goreportcard.com/badge/github.com/arthurkushman/buildsqlx)](https://goreportcard.com/report/github.com/arthurkushman/tiktok-api)
[![GoDoc](https://github.com/golang/gddo/blob/c782c79e0a3c3282dacdaaebeff9e6fd99cb2919/gddo-server/assets/status.svg)](https://godoc.org/github.com/arthurkushman/tiktok-api)
[![codecov](https://codecov.io/gh/arthurkushman/tiktok-api/branch/master/graph/badge.svg)](https://codecov.io/gh/arthurkushman/tiktok-api)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](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.