How to leverage the GPT API to create bulk titles and article outlines using Google Sheets

I'm lost here. Where (which cells) do we paste the prompt & the code?
Place the formula anywhere you want the output to go and the prompt on the cell specified in the formula A18, however you can change the cell to whatever cell you’d like, as long as the prompt is in it. Make sense?
 
i get
error
openai error: http code; 404 message: invalid URL (pot/v1/chat/completions)(line 2263)
 
Hi, in this guide I will be showing you how you can leverage the power of GPT-3.5-Turbo to create article titles and outlines based on a list of keywords.

What you will need for this to work:
  • A list of keywords you want to target
  • The “GPT for sheets” plugin for google sheets
  • A valid OpenAI API key (Get yours here)
  • A cup of coffee or two to keep you focused (optional)
Let’s waste no more time and get right into it.

Installing GPT for sheets

Go to here and install the add-on.

There, wasn’t that hard now, was it?

Adjusting the settings of GPT for sheets

  • Open a new spreadsheet
  • Click on add-ons
  • Hover over “GPT for Sheets and Docs”
  • Click on “Set API Key”
  • Input your api key and click on “Check” then “Save API Key”
Now you’ve set your API key for the add-on.

Now onto the fun part.

1. Copy the prompt below and paste it into Cell A1

Code:
Task: Generate an article title of maximum 60 characters with the keyword in the beginning

2. Paste your list of keywords that you want to target in the cells below, like so:
View attachment 246049

3. Copy the formula below and paste it into Cell B2

Code:
=gpt($A$1;A2;0,3;1000;"gpt-3.5-turbo")

It should look like this:
View attachment 246051

4. Drag the bottom right corner of the B2 Cell down to cover the amount of keywords you have

It should look like this:
View attachment 246052

Release your mouse button and it should copy the formula dynamically to the cells below

It should look something like this:

View attachment 246053

Now you have your titles, so how do we create our article outlines from these? Easy. Just follow the same steps but change the prompt to:

Code:
Task: Generate an article outline with h1-h3 titles based on the title

And change the formula to:

Code:
=gpt($A$18;A2;0,3;1000;"gpt-3.5-turbo")

And it should look something like this:

View attachment 246054

So there you have it, leveraging the GPT API to create bulk article titles and outlines in google sheets.

Known issues:

  • Sometimes you will receive the following error: “Error: you have reached your requests per minute rate limit. Please wait one minute then retry. Set up a payment method on OpenAI dashboard in order to increase your rate limit: https://platform.openai.com/account/billing/overview It will be increased to 3500 requests per minute after 48 hours.”

Solution: Either set up a payment method and increase your rate limit or update the cell after a little while and it will work.

  • The prompts give bad results
Solution: Experiment with different prompts to achieve the result you want. The provided prompts are merely examples of what you can use.

  • If you leave the sheet and come back after a couple of hours the titles and outlines will change because the GPT API will run once more.
Solution: Select the titles and outlines you want to keep the same then go to the GPT for sheets addon and click "Replace GPT formulas with values in selection"
OR: if you want to keep ALL the titles and outlines, instead click on "Replace GPT formulas with values in entire sheet"

I hope you liked this little guide and found it useful.

Cheers!


On the code to generate the Outline, isn't it better to target the cell of the generated title instead of the keyword? (in your example, it should be B2 instead of A2)

so the code becomes:

=gpt($A$18;A2;0,3;1000;"gpt-3.5-turbo")

And then drag/drop for the remaining titles.
 
On the code to generate the Outline, isn't it better to target the cell of the generated title instead of the keyword? (in your example, it should be B2 instead of A2)

so the code becomes:

=gpt($A$18;A2;0,3;1000;"gpt-3.5-turbo")

And then drag/drop for the remaining titles.
Good catch, that is a typo I missed.

New format should be:
=gpt($A$18;B2;0,3;1000;"gpt-3.5-turbo")
 
Place the formula anywhere you want the output to go and the prompt on the cell specified in the formula A18, however you can change the cell to whatever cell you’d like, as long as the prompt is in it. Make sense?
Got it. Thanks
 
There are two kinds of people on this forum:
Those crying about Chat GPT and those grasping the opportunity and making something of it.

Good stuff mate.
Exactly.. actually the writer can use it to add more value in the content.
 
Im stuck at gpt function. Error :
OpenAi error : HTTP code 404 Message : Invalid URL(POST /v1/chat/completions) (line2336)
 
Quick tip: Take it a step further and create a prompt that takes the outlines and writes an article based on it.

Now, as soon as you upload a list of keywords, you'll have articles finished for them within 5 minutes.

Of course, they are going to need editing.
Nice. Can you please share an example of the prompt ou use to generate the full article?
 
Im stuck at gpt function. Error :
OpenAi error : HTTP code 404 Message : Invalid URL(POST /v1/chat/completions) (line2336)
I have never received this error message, so I'm not sure how to fix it. Try following the guide step by step from the beginning again and make sure everything is correct.
It's a great guide to create bulk content.
Works great.
Thanks a lot mate
Cheers!
Nice. Can you please share an example of the prompt ou use to generate the full article?
I used this prompt:
Code:
Task: based on the article outline, write an article with 2 paragraphs of text for each title
However, it's very basic, and I would advise you to experiment and look at some of the other threads about prompts and prompt engineering here at BHW.

Here are some that might be of help:
https://www.blackhatworld.com/seo/advanced-chatgpt-prompt-engineering.1476644/https://www.blackhatworld.com/seo/g...uality-long-form-content-with-openai.1459073/
 
Back
Top