This page will explain how to use folder and file name patterns.
When uploading large volumes of website screenshots to your cloud repository, it's important to have a clear and consistent naming convention. This is where dynamic folder and file name patterns can be incredibly useful.
A folder and file name pattern is simply a string that can contain multiple variables that are replaced with actual values when the screenshot is uploaded to your cloud storage account. Variables are indicated by single curly braces around them. For example, a {domain} {YYYY}
pattern might render the value of the domain variable (e.g. example.com) and the current year (e.g. 2023) in the current context, resulting in a file name like example.com 2023.png
.
Dynamic patterns can help you organize and manage your screenshots more effectively, making it easier to locate and retrieve specific screenshots when needed. They can also save you time and effort by automating the naming process and ensuring that each screenshot is named consistently and accurately.
If you're using a cloud storage service like Azure Blob Storage or an AWS bucket to store your website screenshots, dynamic patterns can be a powerful tool for streamlining your workflow and maximizing the benefits of cloud storage.
There are several variables available as described below.
The examples below are based on a pattern with a combination of variables.
The image type such as .png or .jpeg is automatically added to the file path.
Folder Pattern | File Pattern | Full Path Output |
---|---|---|
{domain} | {id} | example.com/23eb2408ed0e4770bc4d53a37ee26357.png |
{YYYY-MM-DD} | myscreenshot | 2020-08-25/myscreenshot.png |
{datetime} | image {url} | 2020-08-25 23-50-45/image https_www.example.com_product.png |
{filename} - {search} | products_phones - size_large_tab_overview.png |
Variable | Output | Case Sensitive | |
---|---|---|---|
Year | YY | 20 21 ... 29 30 | No |
YYYY | 2020 2021 ... 2029 2030 | No | |
Month | M | 1 2 ... 11 12 | Yes |
MM | 01 02 ... 11 12 | Yes | |
MMM | Jan Feb ... Nov Dec | Yes | |
MMMM | January February ... November December | Yes | |
Day of Month | D | 1 2 ... 30 31 | Yes |
DD | 01 02 ... 30 31 | Yes | |
Day of Week | d | 0 1 ... 5 6 | Yes |
ddd | Sun Mon ... Fri Sat | Yes | |
dddd | Sunday Monday ... Friday Saturday | Yes | |
Hour | H | 0 1 ... 22 23 | No |
HH | 00 01 ... 22 23 | No | |
Minute | m | 0 1 ... 58 59 | Yes |
mm | 00 01 ... 58 59 | Yes | |
Second | s | 0 1 ... 58 59 | Yes |
ss | 00 01 ... 58 59 | Yes | |
Franctional Second | S | 0 1 ... 8 9 | Yes |
SSS | 000 001 ... 998 999 | Yes | |
Dates | date | 2020-08-25 (YYYY-MM-DD) | No |
date_IANA/Timezone date_Australia/Brisbane | 2020-08-25 (YYYY-MM-DD) in Brisbane timezone (see IANA Timezones) | Yes | |
datetime | 2020-08-25 23-50-45 (YYYY-MM-DD HH-mm-ss) | No | |
datetime_IANA/Timezone datetime_Australia/Brisbane | 2020-08-25 23-50-45 (YYYY-MM-DD HH-mm-ss) in Brisbane timezone (see IANA Timezones) | Yes | |
dateiso | 2020-08-25T01-13-09-108Z (see toISOString) | No | |
dateutc | Sun 09 Aug 2020 01-13-09 GMT (see toUTCString) | No | |
datelocal | 8-9-2020 1-13-09 PM (see toLocaleString) | No |
All dates are in UTC format.
The variables are case insensitive (e.g. {domain}
and {DOMAIN}
will be accepted).
The examples below are based on the fictional URL https://www.example.com/products/phones.php?size=large&tab=overview
Variable | Output |
---|---|
uuid | 23eb2408-ed0e-4770-bc4d-53a37ee26357 |
id | 23eb2408ed0e477...a37ee26357 |
url | https_www.example.com_...overview |
protocol | https |
hostname (or domain) | www.example.com |
pathname | _products_phones_php |
filepath | products_phones |
search | size_large_tab_overview |
Use the values in the request parameters (query string or body).
Boolean values that are true will be replaced with the name of the property as shown in the examples below.
Sample URL https://api.addscreenshots.com/screenshots?apikey=YOUR_API_KEY&width=1366&height=768&quality=80&fullpage=true&mobile=true&grayscale=false&url=youtube.com
Variable | Output |
---|---|
width | 1366 |
height | 768 |
quality | 80 |
fullpage | fullpage (name of the boolean parameter when true) |
mobile | mobile |
grayscale | (empty since it is set to false) |
Use the folder and file tester below to see a sample folder and filename output based on dynamic patterns.
Note that the request variables are limited to width, height, quality, fullpage, mobile and grayscale for this demo.