Close Menu
GeekBlog

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    YouTube Rewrote Its Gameplay Violence Rules Before GTA 6, and It All Comes Down to 15 Seconds

    September 9, 2026

    OpenAI Says It Built an Automated Research Intern. It Also Wrote the Test and Graded Its Own Paper.

    September 9, 2026

    Bernie Sanders Wants a Corporate Death Penalty for AI Labs. The Hard Part Is Defining What He Is Banning.

    September 9, 2026
    Facebook X (Twitter) Instagram Threads
    GeekBlog
    • Home
    • Mobile
    • Tech News
    • Blog
    • Gaming
    • Smartwatch
    • How-To Guides
    • AI & Software
    Facebook
    GeekBlog
    Home»Blog»How to Embed TikTok Videos on a Website or App
    Blog

    How to Embed TikTok Videos on a Website or App

    Ethan CaldwellBy Ethan CaldwellSeptember 9, 20268 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Email Copy Link
    Smartphone on a tripod showing the TikTok app
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link

    There are three ways to put a TikTok on a page, and picking the wrong one is why embeds break. Copy the blockquote TikTok gives you and it works everywhere but loads a lot of script. Call the oEmbed endpoint and you can build embeds dynamically from a URL. Render a thumbnail first and load the player on click, and you keep the page fast and stop TikTok tracking every visitor who never presses play.

    Quick answer: On desktop, open the video on tiktok.com, click Share, then Embed, and paste the blockquote and script tag into your page. For dynamic pages, request https://www.tiktok.com/oembed?url=VIDEO_URL and use the html field it returns. Both need https://www.tiktok.com/embed.js to run, so make sure your content security policy allows it.

    All three approaches use the same underlying markup, so it helps to understand that first. Everything below follows TikTok’s own embed documentation.

    Method 1: the copy and paste embed

    This is the official route and the one to use for a handful of videos in an article or a landing page.

    Open the video on tiktok.com in a desktop browser. The mobile app does not offer the embed option, which trips people up constantly. Click Share, choose Embed, then copy the code. You get something like this.

    <blockquote class="tiktok-embed"
      cite="https://www.tiktok.com/@scout2015/video/6718335390845095173"
      data-video-id="6718335390845095173"
      data-embed-from="oembed"
      style="max-width: 605px;min-width: 325px;">
      <section></section>
    </blockquote>
    <script async src="https://www.tiktok.com/embed.js"></script>

    The blockquote is a placeholder. The script finds every element with the tiktok-embed class and swaps in an iframe. You only need the script tag once per page no matter how many videos you embed. If you are also measuring conversions from these pages, see our guide to setting up the TikTok Pixel.

    Warning: Many content management systems strip <script> tags and unknown attributes from post content. WordPress does this by default for non administrator roles. If your embed renders as an empty quote block, sanitisation is the cause, not TikTok.

    Method 2: oEmbed, for anything dynamic

    If your page builds itself from a list of video URLs, you do not want to store hand copied markup. TikTok implements the oEmbed standard, so one request turns a URL into ready made embed code plus the metadata you need for a card.

    curl -s "https://www.tiktok.com/oembed?url=https://www.tiktok.com/@scout2015/video/6718335390845095173"

    No API key, no OAuth, no app review. The response is JSON with the fields the oEmbed specification defines.

    Recommended for you:

    Blog·Sep 4, 2026

    How to Integrate Social Media With Your Marketing Strategy

    FieldWhat you use it for
    htmlThe blockquote markup, ready to inject
    thumbnail_urlThe poster image for a click to load facade
    thumbnail_width, thumbnail_heightReserving space so the layout does not shift
    titleCaption text and image alt attributes
    author_name, author_urlAttribution, which you should always show
    width, heightAspect ratio hints for your container

    Cache the response. A video’s metadata rarely changes, and hitting the endpoint on every page view is both slow and rude. A day of caching is reasonable, with a shorter time to live if you display view counts elsewhere.

    Note: oEmbed is a public convenience endpoint, not part of the authenticated TikTok API. If you need video statistics, comments or the ability to publish, that is the Display API and the Content Posting API, which require an approved developer app. Our overview of the TikTok for Developers documentation explains which product covers what.

    Method 3: click to load, for speed and privacy

    The official embed pulls in a substantial amount of JavaScript and sets cookies before a visitor has expressed any interest in the video. On a page with several TikToks that is a real cost, and in some jurisdictions loading a third party player before consent is a compliance problem.

    The fix is a facade. Render the thumbnail from oEmbed, and only insert the real embed when someone clicks.

    // container holds data-video-id and data-cite from your oEmbed cache
    document.querySelectorAll('.tt-facade').forEach(function (el) {
      el.addEventListener('click', function once() {
        var q = document.createElement('blockquote');
        q.className = 'tiktok-embed';
        q.setAttribute('cite', el.dataset.cite);
        q.setAttribute('data-video-id', el.dataset.videoId);
        q.style.maxWidth = '605px';
        q.style.minWidth = '325px';
        q.appendChild(document.createElement('section'));
        el.replaceWith(q);
    
        if (!document.getElementById('tt-embed-js')) {
          var s = document.createElement('script');
          s.id = 'tt-embed-js';
          s.async = true;
          s.src = 'https://www.tiktok.com/embed.js';
          document.body.appendChild(s);
        }
      }, { once: true });
    });

    Give the facade the same dimensions as the finished player and the page will not jump when the swap happens. That keeps your Cumulative Layout Shift score intact.

    Which method to use

    MethodBest forCost
    Copy and paste blockquoteArticles, one or two videos, non technical editorsHeaviest, loads on every view
    oEmbedFeeds, galleries, user submitted linksOne server request, then cache
    Click to load facadePerformance sensitive pages, consent driven sitesLightest, needs a little code

    Making it responsive

    TikTok ships the embed with max-width: 605px and min-width: 325px inline. Below 325 pixels the player will overflow its parent, which is exactly the width you hit inside a padded card on a small phone. Wrap the embed rather than fighting those values.

    .tt-wrap { max-width: 605px; margin: 24px auto; }
    .tt-wrap .tiktok-embed { margin: 0 auto; }
    @media (max-width: 380px) {
      .tt-wrap { margin-left: -12px; margin-right: -12px; }
    }

    Tip: On AMP pages skip all of this and use the amp-tiktok component instead. It takes the same video URL and handles sizing and lazy loading for you, and arbitrary scripts are not allowed in AMP anyway.

    Embedding inside a native app

    There is no native TikTok player SDK for third party apps. The practical route is a WebView loading a minimal HTML document that contains the blockquote and the embed script. Two things matter: enable JavaScript on the WebView, and set the user agent to a desktop or standard mobile browser string rather than leaving it as your app’s default, because an unexpected agent sometimes gets the fallback player instead of the real one.

    Do not screen scrape the video file and play it in your own player. The terms of service do not allow redistributing the media, and the extracted URLs expire quickly anyway.

    Troubleshooting

    Nothing renders, just an empty box. The script has not run. Check that embed.js is actually loading in the network tab, and that your content security policy allows script-src https://www.tiktok.com and frame-src https://www.tiktok.com.

    It works locally and breaks in production. Almost always a sanitiser or a tag manager stripping the script tag, or a consent manager blocking it until a category is accepted.

    The video shows a blank or unavailable message. The post has been deleted, set to private or made friends only. Embed availability tracks the app exactly, so there is no workaround.

    The player looks different from other sites. Some browsers, particularly a few popular in China, substitute their own player. Nothing on your end causes it and nothing on your end fixes it.

    Layout jumps when the video loads. Reserve space in advance using the thumbnail dimensions from oEmbed.

    Recommended for you:

    Blog·Sep 4, 2026

    How to Set Up a Facebook Ad Campaign Step by Step

    Frequently asked questions

    Do I need a TikTok developer account to embed videos?

    No. Both the copy and paste embed and the oEmbed endpoint are public and need no key, no app registration and no review. A developer account is only required for the authenticated APIs such as Display, Content Posting and Research.

    Can I embed a TikTok video on a blog post?

    Yes. Paste the blockquote and the script into the HTML view of your editor. If your platform strips scripts, add the script once in the theme footer and paste only the blockquote into each post.

    Does embedding a TikTok count as a view?

    Plays in an embedded player are counted by TikTok, though the creator’s in app analytics separate on platform and off platform activity. Attribution shown to visitors is a courtesy you should keep regardless. If you are new to the platform itself, start with our beginner guide to TikTok.

    Why can I not find the embed option on my phone?

    The share sheet in the mobile app does not include it. Open the same video in a desktop browser on tiktok.com and the Embed option appears under Share.

    Will the embed break if the creator changes their username?

    No, as long as you keep the numeric video ID. The cite URL contains the handle and can go stale, but data-video-id is what the player resolves, which is another reason to store the ID rather than only the link.

    The bottom line

    For a couple of videos in an article, take the blockquote from the desktop share menu and move on. For anything that builds pages from data, call oEmbed once, cache the result, and render a thumbnail that swaps in the real player on click. That combination gives you working embeds, a fast page and no third party scripts loading for readers who never wanted to watch. If the goal is reach rather than presentation, our guide to running a TikTok challenge is the next step.

    embeds javascript oembed TikTok web development
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Telegram Email Copy Link
    Previous ArticleMesh Wi-Fi Placement: How Far Apart to Put Nodes and Where
    Next Article Own a Samsung Phone? 10 Settings I Always Change First for the Best User Experience
    Ethan Caldwell

      Ethan Caldwell is GeekBlog's resident Apple specialist, covering the entire Apple ecosystem - iPhone, iPad, Mac, Apple Watch, AirPods and the software that ties them together. A longtime iOS user and gadget collector, Ethan tracks Cupertino's every move, breaking down Apple keynotes, A- and M-series chip benchmarks, iOS feature updates and the rumor mill into clear, practical takes that help readers decide whether the latest Apple hardware is worth the upgrade.

      Related Posts

      11 Mins Read

      South Carolina vs Michigan: Which State Is Better to Live In?

      11 Mins Read

      Are There Cordless Vacuums With Replaceable Batteries?

      12 Mins Read

      How to Use Parabolic SAR (Stop and Reverse) for Day Trading

      10 Mins Read

      Michigan vs Illinois: Which State Is Better to Live In?

      11 Mins Read

      California or Florida: Which State Is Better to Move To?

      11 Mins Read

      Best Front End Development Books to Learn From in 2026

      Top Posts

      How to Change HEIC to JPG on iPhone, Mac, Android and Windows (No Software Needed)

      September 3, 20266 Views

      How to Use YouTube: A Beginner’s Guide

      July 7, 20266 Views

      Gal Gadot’s Lawyers Spent Six Months on One AI Clause. Then SAG Called Them for Pointers.

      September 2, 20265 Views
      Stay In Touch
      • Facebook

      Subscribe to Updates

      Get the latest tech news from FooBar about tech, design and biz.

      Most Popular

      How to Change HEIC to JPG on iPhone, Mac, Android and Windows (No Software Needed)

      September 3, 20266 Views

      Gal Gadot’s Lawyers Spent Six Months on One AI Clause. Then SAG Called Them for Pointers.

      September 2, 20265 Views

      Best Android Smartwatches in 2026: Which One Actually Fits Your Phone

      September 7, 20262 Views
      Our Picks

      YouTube Rewrote Its Gameplay Violence Rules Before GTA 6, and It All Comes Down to 15 Seconds

      September 9, 2026

      OpenAI Says It Built an Automated Research Intern. It Also Wrote the Test and Graded Its Own Paper.

      September 9, 2026

      Bernie Sanders Wants a Corporate Death Penalty for AI Labs. The Hard Part Is Defining What He Is Banning.

      September 9, 2026

      Subscribe to Updates

      Get the latest creative news from FooBar about art, design and business.

      HEICJPG.online - Convert HEIC to JPG online
      Facebook
      • About Us
      • Contact us
      • Privacy Policy
      • Disclaimer
      • Terms and Conditions
      • Editorial Policy
      • Cookie Policy
      © 2026 GeekBlog

      Type above and press Enter to search. Press Esc to cancel.