Giter Site home page Giter Site logo

Where to start? about tiktok-api HOT 9 CLOSED

szdc avatar szdc commented on July 19, 2024
Where to start?

from tiktok-api.

Comments (9)

szdc avatar szdc commented on July 19, 2024

Hey, you'll want to take a look at the listPosts() method of this API, which will list the posts/videos on your profile.

Internally, this makes a call to https://api2.musical.ly/aweme/v1/aweme/post/ with some query string parameters. The query string parameters are documented in the ListPostsRequest interface, which extends a couple of common interfaces for pagination.

Specifically, the main query string parameters for this endpoint are:

  • user_id - your user id
  • count - how many results to return
  • max_cursor - the timestamp offset from which to list posts from.

The response data is documented in the ListPostsResponse interface, which again extends some common interfaces. The relevant keys are:

  • aweme_list - an array of posts
  • max_cursor - the timestamp that you should use in your next request to retrieve the next N results

Each post contains a video key, which points to an object that has a download_addr key that contains the URL you should use to download the video.

You raise a good point - I should see if there is a library to generate some documentation that is more generally accessible.

from tiktok-api.

Zachary24 avatar Zachary24 commented on July 19, 2024

Sorry, I'm still a little confused... Would i use python? Is the user_id the username or an actual id? And some things im a little confused about are below..

const as = 'anti-spam parameter 1';
const cp = 'anti-spam parameter 2'
const mas = 'anti-spam parameter 3';

device_id: '<device_id>',
fp: '<device_fingerprint>',
iid: '<install_id>',
openudid: '<device_open_udid>',

Is there any "working" example? thanks!

from tiktok-api.

szdc avatar szdc commented on July 19, 2024

Each user is assigned a unique numeric identifier, which is their user_id. It cannot be changed and is separate from the user's username (which can be changed). The easiest way to get a user's id is to search for the user - the response data contains a list of users, and each user has a uid field containing their user id.

I don't provide a working example for generating the anti-spam parameters in this library because that would defeat their purpose. I would take a look at the discussion in #9 for some hints about how you could generate them yourself.

device_id, fp, iid and openudid are all identifiers relating to your device, which you could get by intercepting traffic on your Android phone using mitmproxy or similar.

from tiktok-api.

ioio101 avatar ioio101 commented on July 19, 2024

Each user is assigned a unique numeric identifier, which is their user_id. It cannot be changed and is separate from the user's username (which can be changed). The easiest way to get a user's id is to search for the user - the response data contains a list of users, and each user has a uid field containing their user id.

I don't provide a working example for generating the anti-spam parameters in this library because that would defeat their purpose. I would take a look at the discussion in #9 for some hints about how you could generate them yourself.

device_id, fp, iid and openudid are all identifiers relating to your device, which you could get by intercepting traffic on your Android phone using mitmproxy or similar.

What about the timestamps?

from tiktok-api.

szdc avatar szdc commented on July 19, 2024

@ioio101 you generate the timestamp yourself - it is simply the current time when you are making the call.

from tiktok-api.

ioio101 avatar ioio101 commented on July 19, 2024

@ioio101 you generate the timestamp yourself - it is simply the current time when you are making the call.

Are the rest of the device identifiers static? Anything else besides timestamp/anti spam parameters that needs dynamic generation?

from tiktok-api.

szdc avatar szdc commented on July 19, 2024

@ioio101 that's right - the other parameters are static. Note that _rticket is another timestamp (the current time in milliseconds).

from tiktok-api.

TechEmpire11 avatar TechEmpire11 commented on July 19, 2024

By the way, which programming language or platforms CAn I write Tiktok api on?.. Is it ionic or react?

from tiktok-api.

TechEmpire11 avatar TechEmpire11 commented on July 19, 2024

They just placed it there with out showing which platform to run it on.. I know it javascript Es6..but how do you call the api on ionic or react?

from tiktok-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.