# Grounded Research API — Any Question, Your JSON Schema (`rumi7911/grounded-research-api`) Actor

Give it a question and the JSON schema you want back, and get a cited, live-Google-grounded, structured answer matching your schema — no RAG pipeline, no scraping, no synthesis step to build yourself.

- **URL**: https://apify.com/rumi7911/grounded-research-api.md
- **Developed by:** [Muhammad Sohaib Roomi](https://apify.com/rumi7911) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $150.00 / 1,000 research completeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Grounded Research API — Any Question, Your JSON Schema

Give it a question and the JSON schema you want back, and get a cited, live-Google-grounded, structured answer matching your schema. Built for developers and AI agents that need a fact, not a scraped page — no RAG pipeline to write, no page-fetching or synthesis step of your own.

### Why this instead of a generic web-search/RAG tool

Most "AI web search" tools (including Apify's own RAG Web Browser) hand you raw scraped page text and leave the synthesis to you — you still have to parse multiple pages, extract the fact you actually want, and shape it into your own data model. This Actor does that whole pipeline for you: you describe the shape of the answer you want, and you get back exactly that shape, already populated and grounded in a live search, with sources attached.

### What you can use this for

- **AI agents / LLM apps** that need a quick, cited fact lookup as a tool call, without building their own search+extract pipeline.
- **Data enrichment pipelines** — turn a list of entities into structured facts about each one, one schema, repeated calls.
- **Chatbots and internal tools** that need current, sourced answers rather than a model's stale training-data guess.

### Input

| Field | Description | Default |
|---|---|---|
| `question` | What you want researched | population example |
| `outputSchema` | JSON object describing the fields you want back, e.g. `{"population": "number", "foundedYear": "number or null"}` | example schema |
| `context` | Extra detail to scope/disambiguate the question (optional) | — |
| `model` | Gemini model | `gemini-3.8-flash` |
| `apiKey` | Your own Gemini API key (optional — leave blank to use the Actor's key) | — |

Every field has a working default — hit **Start** with no changes and you'll get a result.

### Output

Whatever fields you asked for in `outputSchema`, populated and grounded, plus:

```json
{
  "population": 979882,
  "foundedYear": 1839,
  "state": "Texas",
  "sources": [{ "url": "https://...", "title": "..." }],
  "searchQueries": ["..."],
  "groundingUsed": true,
  "model": "gemini-3.8-flash",
  "verifiedAt": "2026-09-08T12:00:00.000Z"
}
```

### Pricing

Pay-per-event: **$0.15 per question researched**. No subscription, no minimum.

# Actor input Schema

## `question` (type: `string`):

What you want researched. Be specific — this becomes a live Google Search research task, not a memory lookup.

## `outputSchema` (type: `object`):

A JSON object describing the fields you want back and their type/meaning, e.g. {"population": "number", "foundedYear": "number or null"}. Every key you list here will appear as a field in the output, populated from the research (or null if not found).

## `context` (type: `string`):

Any extra detail that helps disambiguate the question or scope the research.

## `model` (type: `string`):

Which Gemini model to use for research and synthesis.

## `apiKey` (type: `string`):

Leave blank to use the Actor's own configured key.

## Actor input object example

```json
{
  "question": "What is the current population of Austin, Texas, and what year was the city founded?",
  "outputSchema": {
    "population": "number, most recent estimate",
    "foundedYear": "number or null if not found",
    "state": "string"
  },
  "context": "",
  "model": "gemini-3.8-flash"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("rumi7911/grounded-research-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("rumi7911/grounded-research-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call rumi7911/grounded-research-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rumi7911/grounded-research-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/p4kTzecFVA0f49A7s/builds/RzWy1D2V7LIPtnSM5/openapi.json
