Extract names to JSON

Extract names and places from a paragraph into JSON

Prompt type: Text
Use case:
Extract Summarize
Open in Google AI Studio

Prompt text

Who are all the people and places named in the paragraph below? Respond in JSON.

Paragraph: Apollo 11 launched from Cape Kennedy on July 16, 1969, carrying Commander Neil Armstrong, Command Module Pilot Michael Collins and Lunar Module Pilot Edwin "Buzz" Aldrin into an initial Earth-orbit of 114 by 116 miles. An estimated 650 million people watched Armstrong's televised image and heard his voice describe the event as he took "...one small step for a man, one giant leap for mankind" on July 20, 1969. 

Sample responses

Sure, here is the JSON object of the people and places named in the paragraph:

{
  "people": [
    "Neil Armstrong",
    "Michael Collins",
    "Edwin \"Buzz\" Aldrin"
  ],
  "places": [
    "Cape Kennedy"
  ]
}

Get code

Enable API key to develop with the Gemini API

You can call this prompt from our Gemini API by integrating the following code into your project.