Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: about 2 months ago
JSON representation

TikTok api sdk for simple video embedding

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.