REGISTER NOW FOR THE KONG AGENTIC ERA WORLD TOUR GOVERN A2A TRAFFIC WITH KONG'S NEW AGENT GATEWAY WHY GARTNER’S “CONTEXT MESH” CHANGES EVERYTHING DON’T MISS API + AI SUMMIT 2026 SEPT 30 – OCT 1
  • [Why Kong](/company/why-kong)Why Kong
    • Explore the unified API Platform
        • BUILD APIs
        • [
          Kong Insomnia](/products/kong-insomnia)
          Kong Insomnia
        • [
          API Design](/products/kong-insomnia/api-design)
          API Design
        • [
          API Mocking](/products/kong-insomnia/api-mocking)
          API Mocking
        • [
          API Testing and Debugging](/products/kong-insomnia/api-testing-and-debugging)
          API Testing and Debugging
        • [
          MCP Client](/products/kong-insomnia/mcp-client)
          MCP Client
        • RUN APIs
        • [
          API Gateway](/products/kong-gateway)
          API Gateway
        • [
          Context Mesh](/products/kong-konnect/features/context-mesh)
          Context Mesh
        • [
          AI Gateway](/products/kong-ai-gateway)
          AI Gateway
        • [
          Event Gateway](/products/event-gateway)
          Event Gateway
        • [
          Kubernetes Operator](/products/kong-gateway-operator)
          Kubernetes Operator
        • [
          Service Mesh](/products/kong-mesh)
          Service Mesh
        • [
          Ingress Controller](/products/kong-ingress-controller)
          Ingress Controller
        • [
          Runtime Management](/products/kong-konnect/features/runtime-management)
          Runtime Management
        • DISCOVER APIs
        • [
          Developer Portal](/products/kong-konnect/features/developer-portal)
          Developer Portal
        • [
          Service Catalog](/products/kong-konnect/features/api-service-catalog)
          Service Catalog
        • [
          MCP Registry](/products/mcp-registry)
          MCP Registry
        • GOVERN APIs
        • [
          Metering and Billing](/products/kong-konnect/features/usage-based-metering-and-billing)
          Metering and Billing
        • [
          APIOps and Automation](/products/apiops-automation)
          APIOps and Automation
        • [
          API Observability](/products/kong-konnect/features/api-observability)
          API Observability
        • [Why Kong?](/company/why-kong)Why Kong?
      • CLOUD
      • [Cloud API Gateways](/products/kong-konnect/features/dedicated-cloud-gateways)Cloud API Gateways
      • [Need a self-hosted or hybrid option?](/products/kong-enterprise)Need a self-hosted or hybrid option?
      • COMPARE
      • [Considering AI Gateway alternatives? ](/performance-comparison/ai-gateway-alternatives)Considering AI Gateway alternatives?
      • [Kong vs. Postman](/performance-comparison/kong-vs-postman)Kong vs. Postman
      • [Kong vs. MuleSoft](/performance-comparison/kong-vs-mulesoft)Kong vs. MuleSoft
      • [Kong vs. Apigee](/performance-comparison/kong-vs-apigee)Kong vs. Apigee
      • [Kong vs. IBM](/performance-comparison/ibm-api-connect-vs-kong)Kong vs. IBM
      • GET STARTED
      • [Sign Up for Kong Konnect](/products/kong-konnect/register)Sign Up for Kong Konnect
      • [Documentation](https://developer.konghq.com/)Documentation
      • FOR PLATFORM TEAMS
      • [Developer Platform](/solutions/building-developer-platform)Developer Platform
      • [Kubernetes and Microservices](/solutions/build-on-kubernetes)Kubernetes and Microservices
      • [Observability](/solutions/observability)Observability
      • [Service Mesh Connectivity ](/solutions/service-mesh-connectivity)Service Mesh Connectivity
      • [Kafka Event Streaming](/solutions/kafka-stream-api-management)Kafka Event Streaming
      • FOR EXECUTIVES
      • [AI Connectivity](/ai-connectivity)AI Connectivity
      • [Open Banking](/solutions/open-banking)Open Banking
      • [Legacy Migration](/solutions/legacy-api-management-migration)Legacy Migration
      • [Platform Cost Reduction](/solutions/api-platform-consolidation)Platform Cost Reduction
      • [Kafka Cost Optimization](/solutions/reduce-kafka-cost)Kafka Cost Optimization
      • [API Monetization](/solutions/api-monetization)API Monetization
      • [AI Monetization](/solutions/ai-monetization)AI Monetization
      • [AI FinOps](/solutions/ai-cost-governance-finops)AI FinOps
      • FOR AI TEAMS
      • [Agent Gateway](/agent-gateway)Agent Gateway
      • [AI Governance](/solutions/ai-governance)AI Governance
      • [AI Security](/solutions/ai-security)AI Security
      • [AI Cost Control](/solutions/ai-cost-optimization-management)AI Cost Control
      • [Agentic Infrastructure](/solutions/agentic-ai-workflows)Agentic Infrastructure
      • [MCP Production](/solutions/mcp-production-and-consumption)MCP Production
      • [MCP Traffic Gateway](/solutions/mcp-governance)MCP Traffic Gateway
      • FOR DEVELOPERS
      • [Mobile App API Development](/solutions/mobile-application-api-development)Mobile App API Development
      • [GenAI App Development](/solutions/power-openai-applications)GenAI App Development
      • [API Gateway for Istio](/solutions/istio-gateway)API Gateway for Istio
      • [Decentralized Load Balancing](/solutions/decentralized-load-balancing)Decentralized Load Balancing
      • BY INDUSTRY
      • [Financial Services](/solutions/financial-services-industry)Financial Services
      • [Healthcare](/solutions/healthcare)Healthcare
      • [Higher Education](/solutions/api-platform-for-education-services)Higher Education
      • [Insurance](/solutions/insurance)Insurance
      • [Manufacturing](/solutions/manufacturing)Manufacturing
      • [Retail](/solutions/retail)Retail
      • [Software & Technology](/solutions/software-and-technology)Software & Technology
      • [Transportation](/solutions/transportation-and-logistics)Transportation
      • [See all Solutions](/solutions)See all Solutions
  • [Pricing](/pricing)Pricing
      • DOCUMENTATION
      • [Kong Konnect](https://developer.konghq.com/konnect/)Kong Konnect
      • [Kong Gateway](https://developer.konghq.com/gateway/)Kong Gateway
      • [Kong Mesh](https://developer.konghq.com/mesh/)Kong Mesh
      • [Kong AI Gateway](https://developer.konghq.com/ai-gateway/)Kong AI Gateway
      • [Kong Event Gateway](https://developer.konghq.com/event-gateway/)Kong Event Gateway
      • [Kong Insomnia](https://developer.konghq.com/insomnia/)Kong Insomnia
      • [Plugin Hub](https://developer.konghq.com/plugins/)Plugin Hub
      • EXPLORE
      • [Blog](/blog)Blog
      • [Learning Center](/blog/learning-center)Learning Center
      • [eBooks](/resources/e-book)eBooks
      • [Reports](/resources/reports)Reports
      • [Demos](/resources/demos)Demos
      • [Customer Stories](/customer-stories)Customer Stories
      • [Videos](/resources/videos)Videos
      • EVENTS
      • [API + AI Summit](/events/conferences/api-ai-summit)API + AI Summit
      • [Agentic Era World Tour](/agentic-era-world-tour)Agentic Era World Tour
      • [Webinars](/events/webinars)Webinars
      • [User Calls](/events/user-calls)User Calls
      • [Workshops](/events/workshops)Workshops
      • [Meetups](/events/meetups)Meetups
      • [See All Events](/events)See All Events
      • FOR DEVELOPERS
      • [Get Started](https://developer.konghq.com/)Get Started
      • [Community](/community)Community
      • [Certification](/academy/certification)Certification
      • [Training](https://education.konghq.com)Training
      • COMPANY
      • [About Us](/company/about-us)About Us
      • [We're Hiring!](/company/careers)We're Hiring!
      • [Press Room](/company/press-room)Press Room
      • [Contact Us](/company/contact-us)Contact Us
      • [Kong Partner Program](/partners)Kong Partner Program
      • [Enterprise Support Portal](https://support.konghq.com/s/)Enterprise Support Portal
      • [Documentation](https://developer.konghq.com/?_gl=1*tphanb*_gcl_au*MTcxNTQ5NjQ0MC4xNzY5Nzg4MDY0LjIwMTI3NzEwOTEuMTc3MzMxODI2MS4xNzczMzE4MjYw*_ga*NDIwMDU4MTU3LjE3Njk3ODgwNjQ.*_ga_4JK9146J1H*czE3NzQwMjg1MjkkbzE4OSRnMCR0MTc3NDAyODUyOSRqNjAkbDAkaDA)Documentation
  • [](/search)
  • [Login](https://cloud.konghq.com/login)Login
  • [Book Demo](/contact-sales)Book Demo
  • [Get Started](/products/kong-konnect/register)Get Started
[Blog](/blog)Blog
  • [AI Gateway](/blog/tag/ai-gateway)AI Gateway
  • [AI Security](/blog/tag/ai-security)AI Security
  • [AIOps](/blog/tag/aiops)AIOps
  • [API Security](/blog/tag/api-security)API Security
  • [API Gateway](/blog/tag/api-gateway)API Gateway
|
    • [API Management](/blog/tag/api-management)API Management
    • [API Development](/blog/tag/api-development)API Development
    • [API Design](/blog/tag/api-design)API Design
    • [Automation](/blog/tag/automation)Automation
    • [Service Mesh](/blog/tag/service-mesh)Service Mesh
    • [Insomnia](/blog/tag/insomnia)Insomnia
    • [Event Gateway](/blog/tag/event-gateway)Event Gateway
    • [View All Blogs](/blog/page/1)View All Blogs
We're Entering the Age of AI Connectivity [Read more](/blog/news/the-age-of-ai-connectivity)Read moreProducts & Agents:
    • [Kong AI Gateway](/products/kong-ai-gateway)Kong AI Gateway
    • [Kong API Gateway](/products/kong-gateway)Kong API Gateway
    • [Kong Event Gateway](/products/event-gateway)Kong Event Gateway
    • [Kong Metering & Billing](/products/usage-based-metering-and-billing)Kong Metering & Billing
    • [Kong Insomnia](/products/kong-insomnia)Kong Insomnia
    • [Kong Konnect](/products/kong-konnect)Kong Konnect
  • [Documentation](https://developer.konghq.com)Documentation
  • [Book Demo](/contact-sales)Book Demo
  1. Home
  2. Blog
  3. Engineering
  4. Docs as Code: Screenshot Automation at Kong
[Engineering](/blog/engineering)Engineering
October 24, 2023
3 min read

# Docs as Code: Screenshot Automation at Kong

Angel Guarisma

Imagine this: You're documenting an unreleased feature, and your documentation requires screenshots. However, you're working in an internal environment that includes features you don't want to reveal to the public. What do you do?

We faced this exact situation during the API Summit release when we needed to capture screenshots of the new Kong Konnect Plus dashboard while our internal environment also showcased Mesh Manager features.

In days gone by, tackling such a challenge meant delving into browser dev tools, meticulously hiding elements each time, and redoing the process after refreshing the browser. Now, there’s a better way. Let me introduce you to shot-scraper.

## Kong ❤️ shot-scraper 

At Kong, we’ve adopted [shot-scraper](https://shot-scraper.datasette.io/en/stable/)shot-scraper, a tool for taking automated screenshots of websites, as part of our core workflow. We’ve even extended shot-scraper with [the capability to run macros](https://github.com/simonw/shot-scraper/pull/111)the capability to run macros.

Macros are predefined JavaScript functions that can be executed at specific moments, enhancing your ability to interact with the web page and set up conditions prior to capturing the screenshot. 

To solve the issue outlined above, I crafted a simple shot-scraper macro to remove elements from the page:

- type: function
  name: removeElementBySelector
  javascript: |
    function (selector) {
      const elementToDelete = document.querySelector(selector);
      if (elementToDelete) {
        elementToDelete.parentNode.removeChild(elementToDelete);
      }
    }

This macro was used in the following shot-scraper script to hide the Mesh Manager section in the sidebar:

- output: ../../app/assets/images/docs/konnect/konnect-control-plane-dashboard.png
  url: https://cloud.konghq.com/us/gateway-manager/
  wait: 4000
  width: 1920
  height: 800
  javascript: |
    removeElementBySelector('a.sidebar-item-link[href="/us/mesh-manager/"]');

Without shot-scraper, we would have had to edit the page manually using developer tools each time the page loaded:

## What else can shot-scraper do?

We use shot-scraper for a variety of different tasks:

1. Take a standard screenshot of a dashboard:

- output: ../../app/assets/images/docs/konnect/konnect-control-plane-dashboard.png
  url: https://cloud.konghq.com/us/gateway-manager/
  wait: 4000
  width: 1920
  height: 800

2. Update the page with random values (in this case the number of requests):

- output: ../../app/_assets/images/docs/konnect/konnect-dashboard.png
  url: https://cloud.konghq.com/us/overview/
  wait: 4000
  width: 1920
  height: 1080
  javascript: |
    async () => {
    updateDivWithRandomNumberInRange('div[data-v-ee980c4c][style="font-size: 22px;"]', 30000, 600000);
    }

3. Add annotations to specific elements on a page that you can reference in written documentation:

- output: ../../app/_assets/images/docs/konnect/konnect-vaults.png
  url: https://cloud.konghq.com/us/runtime-manager/988f1fa1-fd93-4ef7-a1f5-c481bd86e945/vaults
  wait: 4000
  width: 1920
  height: 1080
  javascript: |
    async () => {
      const sidebarItem = document.querySelector("#subnav-gateway-manager > li.sidebar-item-secondary.active > a");
      const prefixItem = getTestId('prefix');
      const addItem = getTestId('toolbar-add-vault');
      const menuItem = getTestId('overflow-actions-button');

      annotateNumber(sidebarItem, { number: 1, position: { left: "100px" } });
      annotateNumber(addItem, { number: 2, position: { right: "-50px" } });
      annotateNumber(prefixItem, { number: 3, position: { left: "-35px", top: "4px" } });
      annotateNumber(menuItem, { number: 4, position: { right: "-35px" } });
    }

4. Interact with the page like a user. Here, we configure a graph in our Analytics dashboard builder:

- output: ../../app/_assets/images/docs/konnect/custom-reports/api-usage-by-application.png
  url: https://cloud.konghq.com/us/analytics/reports/create
  wait: 4000
  width: 1920
  height: 1080
  javascript: |
    async () => {
    // Configure the report we want to see
    const form = document.querySelector(".report-form form");

    // Set the report title
    form.querySelector("h1").textContent = "API Usage by Application (last 30 days)";
    await sleep(500);

    // Select "Vertical Bar Chart" and wait for the UI to update
    await activateByTestId('chart-type-VerticalBar');

    // And the time duration
    await activateByTestId('k-datetime-picker-display');
    await activateByTestId('select-timeframe-30d');
    await activateByTestId('k-datetime-picker-submit');

    // Group by Service
    form.querySelector(".select-group-by .k-select-input").click();
    await sleep(200);
    await activateByTestId('k-select-item-Service');

    // Then by Application
    form.querySelector(".select-then-by .k-select-input").click();
    await sleep(200);
    await activateByTestId('k-select-item-Application');

    // Wait for the chart to render
    await sleep(1000);

    // The "selector" option didn't work well for some reason. This takes a nice screenshot without sidebar/header
    cleanupPage();
    }

Using shot-scraper, our docs team can write scripts once and have screenshots that are up-to-date, accurate, and reproducible by anyone on the team. 

## Why do you need automated screenshots for docs?

Screenshots in docs, in my experience, struggle with the following things: 

  • - **Inaccuracy**: The UI evolves, but the screenshots remain static.
  • - **Inconsistent appearances**: Screenshots vary in size, resolution, and quality.
  • - **Resource consumption**: Keeping these elements synchronized with the rapid pace of UI development consumes valuable time.

So, what's the solution when you want accurate screenshots without spending hours on cropping and resizing? Automation!

This is the only way to ensure that you are insulated from the pace of UI development and design while still being able to provide screenshots in your documentation. 

For the Kong Docs team, shot-scraper is an invaluable tool that allows us to provide accurate documentation including screenshots to our readers. 

## Tips for automating screenshot workflows

If you're considering making the transition from manual to automated screenshot workflows, here are some practical tips:

  • - **Prune existing screenshots**: Ensure that every screenshot serves a clear purpose. Screenshots are essential communication tools in documentation; they should convey key concepts, generate user interest, or showcase a visually appealing UI. However, they shouldn't compensate for poor UX design.
  • - **Build a process**: Build a process around shot-scraper, or build shot-scraper into an existing process. Whether that’s a release process that concludes with running shot-scraper. Or a GitHub action that automates running shot-scraper. Creating a dozen scripts to never run them is just as much of a waste of resources as trying to configure your dev tools to take the same screenshot several times. 
  • - **Advocate for your approach**: Advocating for this approach is a vital part of any docs-as-code strategy. Just like other aspects like version control, automated testing, and plain text documentation, it requires a collective effort. 

To successfully implement shot-scraper, everyone on your team should understand its value. Encourage your team members to embrace automation by showcasing the significant time savings it offers and its contribution to documentation accuracy. This approach can benefit not only the documentation team but also other departments, such as design teams, who can confidently make UI changes without burdening the documentation process. 

Shot-scraper as part of your docs arsenal can help bring efficiency, accuracy, and efficacy to your documentation.





- [API Documentation](/blog/tag/api-documentation)API Documentation- [Automation](/blog/tag/automation)Automation- [API Development](/blog/tag/api-development)API Development

## More on this topic

_Videos_

## From Zero to Hero: A Roadmap for Automating the Development Lifecycle Across Any Environment with GitOps

_Demos_

## API Security Automation: From Development to Deployment

## See Kong in action

Accelerate deployments, reduce vulnerabilities, and gain real-time visibility. 

[Get a Demo](/contact-sales)Get a Demo
**Topics**
- [API Documentation](/blog/tag/api-documentation)API Documentation- [Automation](/blog/tag/automation)Automation- [API Development](/blog/tag/api-development)API Development
Angel Guarisma

Recommended posts

# Build with Confidence: Beta API Specs Available Now

Kong Logo
[Engineering](/blog)EngineeringSeptember 8, 2023

Few things are more frustrating than encountering a product with either no documentation or worse: documentation that leads you astray. When it comes to developing APIs, schemas typically define how requests and responses are formatted and guide how

Angel Guarisma
[](https://konghq.com/blog/engineering/beta-api-specs)

# Use ChatGPT to Develop a SOAP/XML Custom Kong Konnect Plugin

[Engineering](/blog)EngineeringAugust 1, 2023

Today, APIs are based on modern communication patterns: REST, GraphQL, or gRPC. But two decades ago, the majority of Web Services were developed with SOAP/XML. In this blog, we’ll explain how Kong Konnect can manage SOAP/XML Web Services by creat

Jerome Guillaume
[](https://konghq.com/blog/engineering/chatgpt-soap-xml-kong-plugin)

# From Kinesis to Kafka

[Engineering](/blog)EngineeringMarch 24, 2023

Real-time Data Analytics Platform from Zero to One At the beginning of 2021, a brand new data team was assembled to build a real-time data platform for Kong’s SaaS platform, Konnect. Our mission is to provide top-notch real-time API analytics feat

Zhong Chen
[](https://konghq.com/blog/engineering/from-kinesis-to-kafka)

# API Product Management Guide: 6 Strategies for the Full Lifecycle

[Enterprise](/blog)EnterpriseJanuary 14, 2026

APIs are the connective tissue of digital products and services, and they're the lifeblood of AI. APIs shape customer experiences, power partner ecosystems, and accelerate enterprise innovation. As organizations double down on API-first strategies,

Amit Dey
[](https://konghq.com/blog/enterprise/api-product-management-guide)

# What is Docs as Code?

[Learning Center](/blog)Learning CenterApril 14, 2025

If you take a step back and think about today’s software development landscape, you could argue that documentation is just as important as the code itself.  That’s because traditional documentation workflows — where documentation is manually updat

Kong
[](https://konghq.com/blog/learning-center/what-is-docs-as-code)

# Cut Costs, Boost Speed: The AI Proxy Revolution for Developers

[Enterprise](/blog)EnterpriseFebruary 14, 2025

The AI Proxy Revolution has changed the way developers operate, helping save money and speed up development. This new approach improves how systems talk to each other and allows for quicker, more efficient data exchange. Modern software development

Kong
[](https://konghq.com/blog/enterprise/how-ai-proxies-cut-development-costs)

# Guide to API Testing: Understanding the Basics

[Engineering](/blog)EngineeringSeptember 1, 2025

Key Takeaways API testing is crucial for ensuring the reliability, security, and performance of modern applications. Different types of testing, such as functional, security, performance, and integration testing, should be employed to cover all aspe

Adam Bauman
[](https://konghq.com/blog/engineering/api-testing-understanding-the-basics)

## Ready to see Kong in action?

Get a personalized walkthrough of Kong's platform tailored to your architecture, use cases, and scale requirements.

[Get a Demo](/contact-sales)Get a Demo

## step-0

  • ## Company

    • [About Kong](/company/about-us)About Kong
    • [Customers](/customer-stories)Customers
    • [Careers](/company/careers)Careers
    • [Press](/company/press-room)Press
    • [Events](/events)Events
    • [Contact](/company/contact-us)Contact
    • [Pricing](/pricing)Pricing
      • Terms
      • Privacy
      • Trust and Compliance
  • ## Platform

    • [Kong AI Gateway](/products/kong-ai-gateway)Kong AI Gateway
    • [Kong Konnect](/products/kong-konnect)Kong Konnect
    • [Kong Gateway](/products/kong-gateway)Kong Gateway
    • [Kong Event Gateway](/products/event-gateway)Kong Event Gateway
    • [Kong Insomnia](/products/kong-insomnia)Kong Insomnia
    • [Documentation](https://developer.konghq.com)Documentation
    • [Book Demo](/contact-sales)Book Demo
  • ## Compare

    • [AI Gateway Alternatives](/performance-comparison/ai-gateway-alternatives)AI Gateway Alternatives
    • [Kong vs Apigee](/performance-comparison/kong-vs-apigee)Kong vs Apigee
    • [Kong vs IBM](/performance-comparison/ibm-api-connect-vs-kong)Kong vs IBM
    • [Kong vs Postman](/performance-comparison/kong-vs-postman)Kong vs Postman
    • [Kong vs Mulesoft](/performance-comparison/kong-vs-mulesoft)Kong vs Mulesoft
  • ## Explore More

    • [Open Banking API Solutions](/solutions/open-banking)Open Banking API Solutions
    • [API Governance Solutions](/solutions/api-governance)API Governance Solutions
    • [Istio API Gateway Integration](/solutions/istio-gateway)Istio API Gateway Integration
    • [Kubernetes API Management](/solutions/build-on-kubernetes)Kubernetes API Management
    • [API Gateway: Build vs Buy](/campaign/secure-api-scalability)API Gateway: Build vs Buy
    • [Kong vs Apigee](/performance-comparison/kong-vs-apigee)Kong vs Apigee
  • ## Open Source

    • [Kong Gateway](https://developer.konghq.com/gateway/install/)Kong Gateway
    • [Kuma](https://kuma.io/)Kuma
    • [Insomnia](https://insomnia.rest/)Insomnia
    • [Kong Community](/community)Kong Community

Increase developer productivity, security, and performance at scale with the unified platform for API management and AI.

  • English
  • Japanese
  • Frenchcoming soon
  • Spanishcoming soon
  • Germancoming soon
© Kong Inc. 2026
Interaction mode