Site icon DataForSEO

Can I set keywords for the generated text?

DataForSEO Content Generation – Generate Text API is designed especially to allow you to create SEO-optimized articles in minutes! Its functionality allows you to set the task as specifically as possible to generate high-quality text suitable for your web pages.

To start with, to set a task, it is only required to specify the topic. In addition, you can specify sub_topics – the secondary topics for the generated text.

With the help of the meta_keywords parameter, you can set a list of up to 10 keywords that will be shortlisted for the generation. This means that the language model will integrate them as new tokens. This improves the interaction between the user and the model, which allows you to generate text relevant to the query.

You can go further by adding another crucial parameter for SEO – description. A short sentence that conveys the main point of the article helps not only readers but also language models to contribute that point to the generated text.

Example request:

[
  {
    "topic": "Steve Jobs",
    "sub_topics": [
      "Apple",
      "Pixar",
      "Amazing Products"
    ],
    "description": "Take a closer look at Steve Jobs' life and his incredible impact on the tech industry, with a special focus on the development of the iPhone.",
    "meta_keywords": [
      "iPhone",
      "sell",
      "CEO"
    ],
    "creativity_index": 0.8,
    "word_count": 200,
    "write_conclusion": true
  }
]

{
    "version": "0.1.20221214",
    "status_code": 20000,
    "status_message": "Ok.",
    "time": "6.6731 sec.",
    "cost": 0.0129,
    "tasks_count": 1,
    "tasks_error": 0,
    "tasks": [
        {
            "id": "02161338-4426-0502-0000-eeb570df7937",
            "status_code": 20000,
            "status_message": "Ok.",
            "time": "6.6443 sec.",
            "cost": 0.0129,
            "result_count": 1,
            "path": [
                "v3",
                "content_generation",
                "generate_text",
                "live"
            ],
            "data": {
                "api": "content_generation",
                "function": "generate_text",
                "topic": "Steve Jobs",
                "sub_topics": [
                    "Apple",
                    "Pixar",
                    "Amazing Products"
                ],
                "description": "Take a closer look at Steve Jobs' life and his incredible impact on the tech industry, with a special focus on the development of the iPhone.",
                "meta_keywords": [
                    "iPhone",
                    "sell",
                    "CEO"
                ],
                "creativity_index": 0.8,
                "word_count": 200,
                "write_conclusion": true
            },
            "result": [
                {
                    "input_tokens": 102,
                    "output_tokens": 258,
                    "new_tokens": 258,
                    "generated_text": "The iPod is the best selling portable music player in history (1). It has been reported that over 250 million iPods have now sold worldwide and it's estimated to be used by 100% of all college students.(2) The success story for this product can't be understated as it was first released just 10 years ago! However, despite being one of the most successful products ever created, there are some people who feel that the iPod should not have won so many awards. I believe these award winners were very deserving but it does seem odd that an MP3 Player would win such prestigious awards. This may be because we've become accustomed to having our lives centered around technology and when something like the iPod came along, we weren't ready to make changes to our lifestyle yet - no more CDs, cassettes or tapes. And although the iTunes store revolutionized how we bought music online, there still isn't anything comparable to the quality of the sound you hear from your own CD collection compared to downloaded tracks. But perhaps what makes the iPod truly amazing is its ability to completely change our daily habits. We use it everywhere, every day - whether its listening to songs while exercising, driving down the highway, going shopping or even watching television - everyone uses their iPods constantly throughout each day.",
                    "supplement_token": "eZXNKA"
                }
            ]
        }
    ]
}

Exit mobile version