{"id":4434,"date":"2026-03-16T20:05:26","date_gmt":"2026-03-16T18:05:26","guid":{"rendered":"https:\/\/fastpixel.io\/?page_id=4434"},"modified":"2026-03-19T09:33:06","modified_gmt":"2026-03-19T07:33:06","slug":"api","status":"publish","type":"page","link":"https:\/\/fastpixel.io\/fr\/api\/","title":{"rendered":"FastPixel API"},"content":{"rendered":"<h1 class=\"wp-block-heading\">FastPixel API<\/h1>\n\n\n\n<p>The FastPixel API lets you send a page URL together with optimization settings so the page can be processed by the optimizer.<\/p>\n\n\n\n<p>This request includes the target page URL, a postback URL for updates, and a <code>settings<\/code> object that controls features such as script rewriting, image rewriting, reduced fonts, image quality, cropping, two-phase loading, and custom CSS.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Endpoint<\/h2>\n\n\n\n<p><strong>Method:<\/strong> <code>POST<\/code><\/p>\n\n\n\n<p><strong>API URL:<\/strong> <a href=\"https:\/\/api.fastpixel.io\/\"><code>https:\/\/api.fastpixel.io\/<\/code><\/a><\/p>\n\n\n\n<p><strong>Endpoint:<\/strong> <code>\/api\/v1\/enqueue<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Request Body<\/h2>\n\n\n\n<p>Send a JSON body like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{<br>  \"url\": \"https:\/\/domain.com\/\",<br>  \"postbackUrl\": \"https:\/\/domain.com\/wp-json\/fastpixel-website-accelerator\/v1\/update\",<br>  \"settings\": {<br>    \"modules\": {<br>      \"ScriptRewrite\": {<br>        \"enabled\": true,<br>        \"settings\": {<br>          \"exclude\": {<br>            \"strings\": [],<br>            \"regexps\": []<br>          },<br>          \"eventHandlersRewrite\": false,<br>          \"rdelay\": 0,<br>          \"excludeGDPR\": true<br>        },<br>        \"injectBootstrapScripts\": true<br>      },<br>      \"ImageRewrite\": {<br>        \"enabled\": true,<br>        \"settings\": {<br>          \"forceImageDimensions\": false<br>        }<br>      },<br>      \"ReducedFonts\": {<br>        \"settings\": {<br>          \"soft\": true<br>        }<br>      }<br>    },<br>    \"imageQuality\": \"glossy\",<br>    \"cropImages\": true,<br>    \"customCSS\": \"\"<br>  },<br>  \"acceptEncoding\": \"gzip\",<br>  \"plugin_version\": \"1.2.3\",<br>  \"siteKey\": \"your-site-key\"<br>}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Request Parameters<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Top-level parameters<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Parameter<\/th><th>Type<\/th><th>Required<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>url<\/code><\/td><td>string<\/td><td>Yes<\/td><td>The page URL to optimize.<\/td><\/tr><tr><td><code>postbackUrl<\/code><\/td><td>string<\/td><td>Yes<\/td><td>Callback URL used to send optimization updates back to the plugin or client.<\/td><\/tr><tr><td><code>settings<\/code><\/td><td>object<\/td><td>Yes<\/td><td>Main optimization settings object.<\/td><\/tr><tr><td><code>acceptEncoding<\/code><\/td><td>string<\/td><td>No<\/td><td>Accepted content encoding. Example: <code>gzip<\/code>.<\/td><\/tr><tr><td><code>plugin_version<\/code><\/td><td>string<\/td><td>No<\/td><td>Version of the plugin or client sending the request.<\/td><\/tr><tr><td><code>siteKey<\/code><\/td><td>string<\/td><td>Yes<\/td><td>Site-specific authentication or identification key.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Settings Object<\/h2>\n\n\n\n<p>The <code>settings<\/code> object contains general optimization options and module-specific configuration.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">General settings<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Parameter<\/th><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>settings.imageQuality<\/code><\/td><td>string<\/td><td>Image optimization level. Supported values shown in the examples: <code>lossless<\/code>, <code>glossy<\/code>, <code>lossy<\/code>. The images are optimized using the ShortPixel image optimization service. <a href=\"https:\/\/shortpixel.com\/knowledge-base\/article\/lossy-glossy-or-lossless-which-one-is-the-best-for-me\/\">Learn more<\/a>.<\/td><\/tr><tr><td><code>settings.cropImages<\/code><\/td><td>boolean<\/td><td>Enables or disables image cropping. Image cropping ensures that images which are not fully visible (such as backgrounds) are cropped to include only the displayed portion, helping reduce file size and save storage space.<\/td><\/tr><tr><td><code>settings.customCSS<\/code><\/td><td>string<\/td><td>Custom CSS to include during processing. It will also be included in CriticalCSS. Can be empty.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Modules<\/h2>\n\n\n\n<p>The <code>settings.modules<\/code> object groups together the feature-specific optimization modules.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">ScriptRewrite<\/h3>\n\n\n\n<p>Controls script rewriting behavior.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Parameter<\/th><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>settings.modules.ScriptRewrite.enabled<\/code><\/td><td>boolean<\/td><td>Enables or disables JavaScript optimization. Set to False for no JS optimization or True to Optimize JS or Delay JS.<\/td><\/tr><tr><td><code>settings.modules.ScriptRewrite.settings.exclude.strings<\/code><\/td><td>array of strings<\/td><td>List of string-based exclusions.<\/td><\/tr><tr><td><code>settings.modules.ScriptRewrite.settings.exclude.regexps<\/code><\/td><td>array<\/td><td>List of regexp-based exclusions.<\/td><\/tr><tr><td><code>settings.modules.ScriptRewrite.settings.eventHandlersRewrite<\/code><\/td><td>boolean<\/td><td>Enables or disables event handler rewriting.<\/td><\/tr><tr><td><code>settings.modules.ScriptRewrite.settings.rdelay<\/code><\/td><td>number<\/td><td>Delay value used by script rewriting. Examples shown include <code>0<\/code> and <code>86400000<\/code>.<\/td><\/tr><tr><td><code>settings.modules.ScriptRewrite.settings.excludeGDPR<\/code><\/td><td>boolean<\/td><td>Enables exclusion behavior for GDPR-related scripts.<\/td><\/tr><tr><td><code>settings.modules.ScriptRewrite.injectBootstrapScripts<\/code><\/td><td>boolean<\/td><td>Enables bootstrap script injection.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Example regexp exclusion:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{<br>  \"type\": \"RegExp\",<br>  \"source\": \"RegExpExclusionMarc\",<br>  \"flags\": \"i\"<br>}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">ImageRewrite<\/h3>\n\n\n\n<p>Controls image rewriting behavior.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Parameter<\/th><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>settings.modules.ImageRewrite.enabled<\/code><\/td><td>boolean<\/td><td>Enables or disables image rewriting.<\/td><\/tr><tr><td><code>settings.modules.ImageRewrite.settings.forceImageDimensions<\/code><\/td><td>boolean<\/td><td>Forces image dimensions when enabled.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">ReducedFonts<\/h3>\n\n\n\n<p>Controls reduced font behavior.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Parameter<\/th><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>settings.modules.ReducedFonts.settings.soft<\/code><\/td><td>boolean<\/td><td>Improve compatibility by also loading the original font in cases where the optimized fonts display glitches.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Parameter Notes<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Image quality values<\/h3>\n\n\n\n<p>The following values are shown in the examples:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>lossless<\/code><\/li>\n\n\n\n<li><code>glossy<\/code><\/li>\n\n\n\n<li><code>lossy<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Crop images<\/h3>\n\n\n\n<p>This setting accepts:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>true<\/code><\/li>\n\n\n\n<li><code>false<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Force image dimensions<\/h3>\n\n\n\n<p>This setting accepts:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>true<\/code><\/li>\n\n\n\n<li><code>false<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Custom CSS<\/h3>\n\n\n\n<p>You can send a CSS string in <code>customCSS<\/code>.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\"customCSS\": \".css Custom css.. demo\"<\/pre>\n\n\n\n<p>An empty string is also valid:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\"customCSS\": \"\"<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Integrations<\/h3>\n\n\n\n<p>Integrations do not affect the request parameters.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Example Requests<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Example 1: Lossless optimization with script rewriting disabled<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">{<br>  \"url\": \"https:\/\/domain.com\/\",<br>  \"postbackUrl\": \"https:\/\/domain.com\/wp-json\/fastpixel-website-accelerator\/v1\/update\",<br>  \"settings\": {<br>    \"modules\": {<br>      \"ScriptRewrite\": {<br>        \"enabled\": false,<br>        \"settings\": {<br>          \"exclude\": {<br>            \"strings\": [],<br>            \"regexps\": []<br>          },<br>          \"eventHandlersRewrite\": false<br>        },<br>        \"injectBootstrapScripts\": true<br>      },<br>      \"ImageRewrite\": {<br>        \"enabled\": true,<br>        \"settings\": {<br>          \"forceImageDimensions\": false<br>        }<br>      },<br>      \"ReducedFonts\": {<br>        \"settings\": {<br>          \"soft\": true<br>        }<br>      }<br>    },<br>    \"imageQuality\": \"lossless\",<br>    \"cropImages\": false,<br>    \"customCSS\": \"\"<br>  },<br>  \"acceptEncoding\": \"gzip\",<br>  \"plugin_version\": \"1.2.3\",<br>  \"siteKey\": \"your-site-key\"<br>}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Example 2: Glossy optimization with script rewriting enabled<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">{<br>  \"url\": \"https:\/\/domain.com\/sample-page\",<br>  \"postbackUrl\": \"https:\/\/domain.com\/wp-json\/fastpixel-website-accelerator\/v1\/update\",<br>  \"settings\": {<br>    \"modules\": {<br>      \"ScriptRewrite\": {<br>        \"enabled\": true,<br>        \"settings\": {<br>          \"exclude\": {<br>            \"strings\": [],<br>            \"regexps\": []<br>          },<br>          \"eventHandlersRewrite\": false,<br>          \"rdelay\": 0,<br>          \"excludeGDPR\": true<br>        },<br>        \"injectBootstrapScripts\": true<br>      },<br>      \"ImageRewrite\": {<br>        \"enabled\": true,<br>        \"settings\": {<br>          \"forceImageDimensions\": false<br>        }<br>      },<br>      \"ReducedFonts\": {<br>        \"settings\": {<br>          \"soft\": true<br>        }<br>      }<br>    },<br>    \"imageQuality\": \"glossy\",<br>    \"cropImages\": true,<br>    \"customCSS\": \"\"<br>  },<br>  \"acceptEncoding\": \"gzip\",<br>  \"plugin_version\": \"1.2.3\",<br>  \"siteKey\": \"your-site-key\"<br>}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Example 3: Lossy optimization with delay and soft reduced fonts disabled<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">{<br>  \"url\": \"https:\/\/domain.com\/\",<br>  \"postbackUrl\": \"https:\/\/domain.com\/wp-json\/fastpixel-website-accelerator\/v1\/update\",<br>  \"settings\": {<br>    \"modules\": {<br>      \"ScriptRewrite\": {<br>        \"enabled\": true,<br>        \"settings\": {<br>          \"exclude\": {<br>            \"strings\": [],<br>            \"regexps\": []<br>          },<br>          \"eventHandlersRewrite\": false,<br>          \"rdelay\": 86400000,<br>          \"excludeGDPR\": true<br>        },<br>        \"injectBootstrapScripts\": true<br>      },<br>      \"ImageRewrite\": {<br>        \"enabled\": true,<br>        \"settings\": {<br>          \"forceImageDimensions\": false<br>        }<br>      },<br>      \"ReducedFonts\": {<br>        \"settings\": {<br>          \"soft\": false<br>        }<br>      }<br>    },<br>    \"imageQuality\": \"lossy\",<br>    \"cropImages\": true,<br>    \"customCSS\": \"\"<br>  },<br>  \"acceptEncoding\": \"gzip\",<br>  \"plugin_version\": \"1.2.3\",<br>  \"siteKey\": \"your-site-key\"<br>}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Response<\/h2>\n\n\n\n<p>The examples show successful requests returning HTTP status <code>200<\/code>.<\/p>\n\n\n\n<p>At the moment, the response body itself is not documented here because it is not included in the source material used for this page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Notes<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>All examples use the <code>\/api\/v1\/enqueue<\/code> endpoint.<\/li>\n\n\n\n<li>The request body is JSON.<\/li>\n\n\n\n<li>The <code>settings<\/code> object is the main place where optimization behavior is configured.<\/li>\n\n\n\n<li><code>ScriptRewrite<\/code>, <code>ImageRewrite<\/code>, and <code>ReducedFonts<\/code> are the modules shown in the available examples.<\/li>\n\n\n\n<li><code>customCSS<\/code> can be empty or contain a CSS string.<\/li>\n\n\n\n<li>Integrations do not change the request parameter structure.<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>FastPixel API The FastPixel API lets you send a page URL together with optimization settings so the page can be processed by the optimizer. This request includes the target page URL, a postback URL for updates, and a settings object that controls features such as script rewriting, image rewriting, reduced fonts, image quality, cropping, two-phase [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","footnotes":""},"class_list":["post-4434","page","type-page","status-publish","hentry"],"blocksy_meta":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"trp-custom-language-flag":false,"betterdocs-category-thumb":false},"uagb_author_info":{"display_name":"Adrian","author_link":"https:\/\/fastpixel.io\/fr\/blog\/author\/adrian\/"},"uagb_comment_info":0,"uagb_excerpt":"FastPixel API The FastPixel API lets you send a page URL together with optimization settings so the page can be processed by the optimizer. This request includes the target page URL, a postback URL for updates, and a settings object that controls features such as script rewriting, image rewriting, reduced fonts, image quality, cropping, two-phase\u2026","_links":{"self":[{"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/pages\/4434","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/comments?post=4434"}],"version-history":[{"count":15,"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/pages\/4434\/revisions"}],"predecessor-version":[{"id":4455,"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/pages\/4434\/revisions\/4455"}],"wp:attachment":[{"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/media?parent=4434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}