Icon

How to Generate Image Alt Tags with Screaming Frog and OpenAI API - Part 2 (Using screamingfrog for Alt)

Learn how to set up Screaming Frog and use the OpenAI API to automatically generate SEO-friendly image alt tags. Step-by-step guide including configuration, custom JavaScript, and workflow tips.

By Sudhanshu Kumar Rai

In this guide, we'll learn how to set up Screaming Frog to generate alt tags for images using the OpenAI API. This process involves configuring Screaming Frog to crawl media files, enabling JavaScript rendering, and adding a custom JavaScript function that uses your OpenAI API key.

We'll also cover how to test the setup, save your script for future use, and export the generated alt tags for further processing.

Let's get started

In the previous video, we learned how to set up the OpenAI API keys. In this video, we will set up Screaming Frog and write alt tags using OpenAI API keys and Screaming Frog.

1
Click on "Configuration"
Step #1: Click on "Configuration"

First, let's begin the setup. In the configuration section, go to Crawl config. Under Crawl, allow media. Then, go to Rendering and enable JavaScript.

2
Click on "Crawl Config"
Step #2: Click on "Crawl Config"
3
Click here
Step #3: Click here
4
Click here on Rendering
Step #4: Click here on Rendering

It is usually text only, so we need to save it at the JavaScript level, then proceed.

5
Click on "JavaScript"
Step #5: Click on "JavaScript"
6
Click on "OK"
Step #6: Click on "OK"

Once that is done, we need to create a custom JavaScript.

7
Click on "Configuration"
Step #7: Click on "Configuration"
8
Click on "Custom JavaScript"
Step #8: Click on "Custom JavaScript"

To create a custom JavaScript, there are several options. You can create JavaScript from scratch, or you can add code from your library.

9
Click on "+ Add from Library"
Step #9: Click on "+ Add from Library"

We can use the pre-built functions that come with Screaming Frog.

10
Click on "User System"
Step #10: Click on "User System"

There is a second function: generate alt tags for images. Here, simply add image URLs if you want to crawl the images. Let's insert it.

11
Click on "for images"
Step #11: Click on "for images"
12
Click on "Insert"
Step #12: Click on "Insert"

Now, go to the edit section.

13
Click on "JS"
Step #13: Click on "JS"

This is the complete function where we have the OpenAPI API key option.

14
Drag "" text " ,"
Step #14: Drag "" text " ,"

We have made some changes. To implement them, I want to remove the entire script and replace it with the rewritten version.

15
Click here
Step #15: Click here
16
Right-click on "Don't guess or include anything you're not sure about ."
Step #16: Right-click on "Don't guess or include anything you're not sure about ."
17
Click on "© Copy"
Step #17: Click on "© Copy"
18
Click here and replace the script with the modified version
Step #18: Click here and replace the script with the modified version

Once it's done, return to this section, copy the saved API key from where you stored it, and paste it here.

19
Drag "'"
Step #19: Drag "'"

Now, test if setup is done properly. Here are steps to test. open Javascript tester window

20
Click here
Step #20: Click here
21
Click on "https://dcgrevamp.wpenginepowered.com/wp-content/uploads/2025/02/reactivating-truck-1.jpg"
Step #21: Click on "https://dcgrevamp.wpenginepowered.com/wp-content/uploads/2025/02/reactivating-truck-1.jpg"
22
Click here
Step #22: Click here
23
Click on "Test"
Step #23: Click on "Test"

Paste image URL on right side in the Javascript tester window and click on test

As we can see, it is providing an alt tag, so the setup appears to be correct.

If you want, we can save it in our user library. This way, we can reuse it and won't need to set it up or make changes each time. Click on Add Snippet to Library.

You can name it anything you like.

24
Click on "Add Snippet to User Lib
Step #24: Click on "Add Snippet to User Lib

24
rary"
Step #25: rary"
26
Click here
Step #26: Click here

27
Click on "OK"
Step #27: Click on "OK"
28
Click here
Step #28: Click here

Now, it is saved.

Next, copy the list of image URLs you want to use.

29
Click here
Step #29: Click here
30
Drag "//dcgrevamp.wpenginepowered.com/wp-content/uploads/2025/02/reactivating-truck-1.jpg"
Step #30: Drag "//dcgrevamp.wpenginepowered.com/wp-content/uploads/2025/02/reactivating-truck-1.jpg"
31
Click on "+ Upload ▼"
Step #31: Click on "+ Upload ▼"

You can use any method to upload the URLs from a file, but here I am entering them manually and pasting them.

32
Click on "Enter Manually"
Step #32: Click on "Enter Manually"
33
Click on "Next"
Step #33: Click on "Next"

Once it is done, click Start.

34
Click on "OK"
Step #34: Click on "OK"

I think it is up and running.

35
Click on "Custom ▼"
Step #35: Click on "Custom ▼"

Go to the custom JavaScript section.

36
Click on "✓ Custom JavaScript"
Step #36: Click on "✓ Custom JavaScript"

You can now see the URLs appearing, and on the right side, all the generated alt tags are displayed.

37
Step #37:

Once the crawl is complete, copy the URLs and paste them into the sheet. Return to Screaming Frog, copy the alt tags, use ChatGPT to generate alt tags for images, and paste them here.

38
Step #38:
39
Drag "https://dcgrevamp.wpenginepowered.com/wp-content/uploads/2025/02/vmt-truck.jpg"
Step #39: Drag "https://dcgrevamp.wpenginepowered.com/wp-content/uploads/2025/02/vmt-truck.jpg"
40
Paste URL in sheet in tab "Paste Data from ScreamingFrog"
Step #40: Paste URL in sheet in tab "Paste Data from ScreamingFrog"
41
Drag "( ChatGPT ) Generate"
Step #41: Drag "( ChatGPT ) Generate"
42
Select and copy all alt
Step #42: Select and copy all alt
43
Click here and paste alt tags
Step #43: Click here and paste alt tags

This sheet is automated. I'll explain in a separate video why I created it and how to use it. This tab is for pasting everything from Screaming Frog. Another tab uses the Vlookup function to automatically fetch all the data.

44
Click on "Alt Tag Template ▾"
Step #44: Click on "Alt Tag Template ▾"
45
Click on "parked on a road"
Step #45: Click on "parked on a road"

It will fetch the alt tag. It will even fetch the inlinks, indexability, and all related data from Screaming Frog.

46
Click here
Step #46: Click here
47
Click here
Step #47: Click here

We will paste it into the second tab.

48
Click on "Paste Data from Screaming Frog ▾"
Step #48: Click on "Paste Data from Screaming Frog ▾"