Using the WordPress mShots Screenshot API

by @edent | # # # | 4 comments | Read ~152 times.

A few years ago, I wrote about Google's secret screenshot API - a slightly cumbersome way to take website screenshots for free.

There's another service which you may find simpler to use - mShots from WordPress.

Here's how it works:

  1. Take any website link:
    • https://twitter.com/JennyVass/status/1067855777040338944
  2. URL Encode it:
    • https%3A%2F%2Ftwitter.com%2FJennyVass%2Fstatus%2F1067855777040338944
  3. Add it to the end of this URL: https://s0.wordpress.com/mshots/v1/
  4. Add ?w=800 to the end:
    • https://s0.wordpress.com/mshots/v1/https%3A%2F%2Ftwitter.com%2FJennyVass%2Fstatus%2F1067855777040338944?w=800

Screenshot of a Tweet. Jenny Vass is saying how much she likes the stickers I sent her.

There are a few things to note. The first time you send a URL to the service it will reply with HTTP 307 (temporary redirect) and you'll get this image:
Generating Preview.

Wait a few seconds and request the URL again, you should now have the image.

You can change the height of the image with h=500. For example: https://s0.wordpress.com/mshots/v1/https%3A%2F%2Fwww.whatsmyua.info?w=800&h=500

The user-agent can't be changed from Headless Chrome.
The user agent of the screenshot tool.

You can request different widths by changing the ?w=800 to something else. The maximum image size is 1280x960. Changing the width doesn't affect the viewport, just the size of the returned image. Although, at some widths, you'll get a centre crop.

A cropped image.

There are no other options. You can't change the image quality, image format, the IP address, geolocation, or anything else. Images will be cached for an unspecified period, so you'll need to mangle the link if you want to regenerate it.

mShots looks like it is abandonware - no new updates to it in the last 2 years. That's a shame, but you get what you pay for.

Support this blog

Enjoyed this blog post? You can say thanks to the author in the following ways:

Donate to charity
Give to charity.
Buy me a birthday present
Amazon Wishlist
Get me a coffee
Donate on Ko-Fi.

4 thoughts on “Using the WordPress mShots Screenshot API

  1. Doug says:

    From Automattic 😉 not WordPress

    1. @edent says:

      Tomato Potato.

      1. Doug says:

        Is that a "it's the same thing?" comment?

        The mshot tool is under the Automattic organisation and the URLs you've tested this with are WordPress.com - it's using Automattic services to generate the screenshot. Calling it a WordPress tool doesn't help the confusion people have.

  2. Matt says:

    If it's used for commercial use please get in touch with Automattic about a license.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.