Using AI to Generate SEO Schema Markup at Scale
Use AI to Generate Search Schemas reliably for your website pages at scale.
Title Title Title Title Title Title Title Title Title Title Title
Schema markup is a form of structured data that helps search engines understand the content of a webpage more accurately. Using the latest AI (LLM) models we can automate the process of generating schema markups for hundreds of pages within minutes of setup and a click of a button. Using AI for this process not only makes it 10 times faster but also more accurate when done at scale, as it's prone for human error to occur when running through such mundane tasks.
In this post we'll break through how we built our Page Schema Generator that you see above using Moonlit's no code editor, and how you can run it at scale for hundreds of pages.
Understanding Schema Markup
Schema markup is a form of structured data that acts as a universal language for search engines, helping them understand the content of a webpage more accurately. This code, which is added to a website's HTML, provides explicit clues about the meaning of a page to search engines, thereby enhancing search visibility and improving how search results are displayed with rich snippets.
Definition & Importance
Schema markup is essentially a semantic vocabulary of tags that you can add to your HTML to improve the way search engines read and represent your page in SERPs. Its importance lies in its ability to:
Structure data in a way that search engines can easily interpret
Improve SERP visibility through enhanced snippets
Lead to better click-through rates and user engagement
Building the "Generate Page Schema" App
Let's now walk through the process of building this tool using Moonlit Platform, it took us less than an hour of building and iterating.
Setting up the Input
Create a Text Input
where users can enter the URL of the page they want to analyze.

Setting up the Logic
Step 1: Fetching the contents
In the first step of our logic, we have two functions; Scrape Webpage
and a HTML to Image
where we pass the page URL input reference to both. The scraping function will fetch the main text contents of the given URL for analysis, in the config we have the Output Format set to Main Text with Images
meaning it will try to find the primary text of the page skiping irrelevant sections such as headers and footers. However, the 'main text' will not always be the relevant choice for a given page, for example assume we have a collection page with a list of products, in that case there isn't a specific section that we want to extract, hence we used the HTML to Images function to also fetch screenshots of the page to capture the full context.
Step 2: Filtering the Screenshots
The HTML to Images
function will return a list of screenshots where each screenshot captures a viewport, so it starts at the top of the page and scrolls the page height taking a screenshot everytime returning the results in a list. In the Python function we are slicing the list to get only the first 3 images as in most scenarios these will be sufficient enough for the AI model to identify the appropriate schema type. This step just simply acts as a barrier for very long pages to reduce token costs, we don't want to end up passing 100 images to the AI model.
Step 3: Writing the Schema
Finally for the AI component of our app, we added a Chat Model
and chose the GPT-4o model as it can iterpret images accurately and it's familiar with Google's markup search schemas. We also instruct it to output the schema in valid json format with the 'Force JSON Output' checkbox ticked.
Here is the prompt used:
<page contents simplified>
{{Page Content}}
</page contents simplified>
I've provided you with the simplified html for a webpage, we attempted to take the main text from the page and give you only the relevant contents, however that sometimes might not be possible if the page is for example a collection page, then there is no 'main text' so I've also provided you with the first 3 screenshots from the top of the page and scrolling down 1 view port at a time for the next screenshot.
Your task is to analyze the page type and contents to generate the appropriate schema. Refer to https://developers.google.com/search/docs/appearance/structured-data/search-gallery to find the proper json schema type and return a valid JSON object containing the schema markup object best fitted for the provided page contents. To the best of your abilities, try to fill all the fields required for the identified json schema type and skip those that are not possible to fill.
App Results

Running the App at Scale
To leverage the power of this app, you can run it at scale for 100s of pages using the Bulk Runs feature, first head over to the Bulk Runs page and:
Create a new job by uploading a CSV file containing the URLs.
Map the columns, ensuring the Page URL column is correctly mapped.
Run the job to iterate over each URL and generate the schema markup.


By following these steps, you can efficiently generate schema markup for any number of pages.
Customizing the App for Your Needs
Similar to all the AI SEO tools you'll find on Moonlit Platform, this app can be cloned and customized to suit your specific requirements, here are some ideas:
Increase the number of filtered page screenshots in the Python code to capture more context when needed.
Provide the AI with more concise instructions for certain fields (ex. use a specific tone and style for the summary field)
While on the complex end, you can extend the logic to analyze competitor schemas using the SERPs Search function with webscraping to further guide the AI.
Build and Explore more AI SEO tools
Moonlit Platform provides SEO professionals with the ultimate no code playground for building AI-powered automation tools. You can explore our library of 30+ curated AI SEO tools built by our team to help save your team time. All of these tools can be copied and customized to fit your specific use-case and can be ran at scale using our Bulk Run feature, you can sign up and start today for free.
Customize this Tool to your Needs
Learn how copy this tool and customize it to your specific use cases.
Run this Tool at Scale
Learn how to run this tool and many others for 1000s of inputs at once.