Track Gemini answers

Get structured output from Google Gemini for any prompt: the generated answer and the sources it cites, exportable as Markdown

post/v1/monitor/gemini

Request

  • Base URL: https://api.answerline.dev
  • URL: https://api.answerline.dev/v1/monitor/gemini
  • Auth: HTTP bearer

Request body

promptstring required

Prompt submitted to Gemini. Gemini takes up to 2,000 characters; a longer prompt is refused with a 400.

countrystring required

Code of the country or region used to localize the response

statestring

State code for targeting below the country level (e.g., "CA"; "DC" included). Allowed only when country is "US". Served for Gemini; on a model that cannot place a state yet, a request that includes it is rejected as a validation error and is not charged.

Example request

{
  "prompt": "Summarize how solar panels work",
  "country": "US",
  "include": {
    "markdown": true,
    "html": false,
    "rawResponse": false
  },
  "state": "CA"
}

Response

Gemini monitoring result (success)

successboolean required

Example response

{
  "success": true,
  "result": {
    "text": "Quantum computing applies quantum mechanics to...",
    "markdown": "**Machine learning** is a branch of artificial intelligence...",
    "html": "https://files.answerline.dev/html/c45a5081-808d-4ed3-9c86-e4baf16c8ab8/1/page-1.html",
    "sources": [
      {
        "position": 1,
        "label": "Wikipedia - Machine Learning",
        "url": "https://en.wikipedia.org/wiki/Quantum_computing",
        "description": "Quantum computing uses qubits to process information..."
      }
    ],
    "citationPills": [
      {
        "label": "Photosynthesis — Wikipedia",
        "citationPillId": 1,
        "url": "https://en.wikipedia.org/wiki/Quantum_computing",
        "domain": "en.wikipedia.org",
        "description": "Quantum computing uses qubits to process information...",
        "position": 1
      },
      {
        "label": "IBM Quantum",
        "citationPillId": 1,
        "url": "https://www.ibm.com/quantum",
        "domain": "ibm.com",
        "position": 3
      }
    ],
    "places": [
      {
        "title": "Sofitel Sydney Darling Harbour",
        "link": "https://www.google.com/travel/search?q=Pullman+Quay+Grand+Sydney+Harbour",
        "thumbnail": "https://lh3.googleusercontent.com/gps-cs-s/example",
        "rating": 4.4,
        "reviews": 1307,
        "type": "5-star hotel",
        "description": "Boutique riverside hotel with elegant rooms, a rooftop terrace, a spa & an all-day café.",
        "price": "$565"
      }
    ],
    "shoppingCards": [
      {
        "position": 1,
        "title": "Brooks Ghost 16",
        "productLink": "https://google.com/search?q=Brooks+Ghost+16&prds=productid%3A123",
        "productId": "16919532047675658099",
        "price": {
          "value": 329.99,
          "currency": "USD",
          "raw": "$329.99"
        },
        "oldPrice": {
          "value": 329.99,
          "currency": "USD",
          "raw": "$329.99"
        },
        "store": "Runner's Depot",
        "storeCount": 4,
        "rating": 4.4,
        "reviews": 1261,
        "brand": "Brooks",
        "catalogId": "14325977521193745857",
        "gpcId": "11523404812175301769"
      }
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.