Example: TikTok Channel Videos

In this example, we will demonstrate how to use the InstantAPI.ai Retrieve API endpoint to scrape detailed information from a TikTok channel. We will provide a complete request and explain what each part of the request does. Additionally, we will show the expected response structure.

Complete Request

Here is a complete request to the Retrieve API endpoint:

Request Breakdown

  • webpage_url: The URL of the TikTok channel you want to scrape.
  • api_method_name: A user-defined name for the API action, in this case, “getAllVideos”.
  • api_response_structure: The expected structure of the APIs response, defined by you. This includes placeholders for the details you want to scrape.
  • api_key: Get your API key.

Expected Response Structure

The expected response structure is defined in the api_response_structure parameter. Here is the formatted version for clarity:

{
  "videos": [
    {
      "name": "<the full title of the video, including any hashtags and emojis>",
      "plays": "<the number of views/plays the video has received>",
      "author": "<the author of the video>",
      "video_url": "<the absolute URL to the video>"
    }
  ]
}

Example Response

When the request is successfully processed, you can expect a response similar to the following:

{
  "videos": [
    {
      "name": "Here’s a little insight in to how much we spent in Tokyo! Hopefully this helps you budget for your trip! I would highly recommend saving because it is not cheap there, probably the most we’ve ever spent on a 1 week vacation 😢 But also worth every dime!! How much I spent in Tokyo black girl How much I spent in Tokyo for a week Tokyo Japan black people vacation Black people in tokyo Black travel tokyo Japan Tokyo Japan itinerary black girl Street food in Tokyo Japan ##howmuchispendinaday##tokyojapan##japan##traveltiktok##travel##blacktravel##blacktravelfeed",
      "plays": "151.4K",
      "author": "morgan.ebissa",
      "video_url": "https://www.tiktok.com/@morgan.ebissa/video/7355248053688765738"
    },
    {
      "name": "Here are 10 things you to do in Tokyo, Japan!! 🇯🇵 #thingstodoinjapan #tokyo #japan #traveltips #travelph #traveltiktok #fyp",
      "plays": "1.5M",
      "author": "wowrenee",
      "video_url": "https://www.tiktok.com/@wowrenee/video/7313216697970838789"
    },
    {
      "name": "Remember these for your Japan trip ✌️ #tokyo #tokyojapan #japantravel #japantrip #traveling #travels #traveltips #travelguide #skyscanneradvocate @Skyscanner",
      "plays": "171.1K",
      "author": "hangrybynature",
      "video_url": "https://www.tiktok.com/@hangrybynature/video/7329923101720956167"
    },
    {
      "name": "3 Things ONLY Foreigners Do in Japan! #japan #japanlife #tokyo #travel #traveltiktok #traveltok #culture #culturaldifference #japanese #japantok #tourism #tourist #traveling #travelling #tourists #tourism #japantrip #japantravel #trip #japaneseculture #japanculture",
      "plays": "3.5M",
      "author": "nixylea",
      "video_url": "https://www.tiktok.com/@nixylea/video/7390758929124429073"
    },
    {
      "name": "Extra details 👇 - Theres a vending machine on site, a ramen station, and a bakery - theres a garden surrounding the entire hotel - we didnt hear any noise at night despite the central location Cost: We reserved a moderate twin room with balcony and city view. This came out to $2195 canadian for two adults for 6 nights. Exact location: 11-3, Kasumigaokamachi Tokyo Japan 160-0013 . . #tokyohotel #japantravel #hotelstay #tokyohotelrecommendations #japanhotel #canadiantraveller",
      "plays": "1.4M",
      "author": "emilie.rossignol.arts",
      "video_url": "https://www.tiktok.com/@emilie.rossignol.arts/video/7379971115298442502"
    },
    {
      "name": "Lemme know if you want a part 2 because I loved it but the culture shock was real at first 😢 #traveltiktok #blacktravel #tokyo #japan #traveltips #blackinjapan",
      "plays": "315K",
      "author": "lisadabahdest",
      "video_url": "https://www.tiktok.com/@lisadabahdest/video/7365908903483297066"
    },
    {
      "name": "Would you travel to Tokyo?🇯🇵 #blacktravelerinjapan #blackexperiencejapan #howtobecomeatraveler #bestjapanitinerarysolo #travelerjapan #tokyojapanblackpeople #thingstodotokyojapan #solotraveltotokyojapan #blackintokyo #kyoto #japanblackpeople #japantokyonightlife #tokyojapanaesthetic #japantravelguide #tokyojapanblackpeople #thingstodointokyojapan2023 #tokyonightlife#tokyojapanatnight4k",
      "plays": "160.9K",
      "author": "bruhayden",
      "video_url": "https://www.tiktok.com/@bruhayden/video/7277202461411101994"
    },
    {
      "name": "Must do activity in Tokyo, Japan is to drive a mario kart style car! 🇯🇵 🚗Monkey Kart Shinjuku Costs about $135USD/person and you get to drive around Tokyo for about an hour. #tokyo #japan #tokyojapan #whattodoinjapan #tokyoactivity #travel #traveljapan #visittokyo #shinjuky #shibuya #traveltiktok #traveltok #bucketlistjapan #mariokart #supermario #fyp",
      "plays": "3.5M",
      "author": "linhforthehuynh",
      "video_url": "https://www.tiktok.com/@linhforthehuynh/video/7236204384781274414"
    },
    {
      "name": "Here’s a breakdown of how many days to spend in each place! #japanitinerary #japantravel #japan",
      "plays": "3.1M",
      "author": "raimeetravel",
      "video_url": "https://www.tiktok.com/@raimeetravel/video/7319974986381364523"
    },
    {
      "name": "What to do if you travel 5 days in Tokyo 🇯🇵 #traveltiktok #travel #traveltokyo #traveljapan",
      "plays": "138.8K",
      "author": "baboo.travel",
      "video_url": "https://www.tiktok.com/@baboo.travel/video/7205291251497716997"
    },
    {
      "name": "Omoide Yokocho, Tokyo A narrow alleyway full of hole in the wall restaurants, layered with the smells of sizzling meat and sounds of sharp clinks of beer bottles. With such an incredible atmosphere, this is the perfect place to immerse yourself in local culture and savour the authentic flavours of Tokyo. After all, you haven’t really been to Tokyo until you eat at a smokey izakaya which fitsonly half a dozen people 🍜🍻 #tokyotravel #tokyoguide #tokyotravelguide #tokyotraveltips #tokyoitinerary #shinjuku #omoideyokocho #placestovisitintokyo #tokyostyle #tokyoaesthetic #tokyoatnight #tokyonights #tokyostreets #tokyoalley #izakayatokyo",
      "plays": "112K",
      "author": "wheretofindme",
      "video_url": "https://www.tiktok.com/@wheretofindme/video/7322205365276364064"
    }
  ]
}

By following this example, you can easily use InstantAPI.ai to scrape and transform data from various web pages into structured data tailored to your needs.