> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dumplingai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search News

> Search global news sources and return structured article metadata.

## Description

This endpoint performs a Google News search using the provided query and optional parameters. It returns information about news articles matching the search criteria.

## Endpoint

```
POST https://app.dumplingai.com/api/v1/search-news
```

## Headers

* **Content-Type:** `application/json`
* **Authorization:** Bearer `<API_KEY>` (required)

## Request Body

```json theme={null}
{
  "query": "string", // Required. The search query for Google News.
  "country": "string", // Optional. Country code for location bias (e.g., "US" for United States).
  "location": "string", // Optional. Specific location to focus the search (e.g., "New York, NY").
  "language": "string", // Optional. Language code for the search results (e.g., "en" for English).
  "dateRange": "string", // Optional. Can be "anyTime", "pastHour", "pastDay", "pastWeek", "pastMonth", or "pastYear"
  "page": "number" // Optional. Page number for paginated results.
}
```

## Responses

### Success (200)

Returns the search results from Google News.

```json theme={null}
{
  "searchParameters": {
    "q": "string",
    "gl": "string", // Optional. Country code if provided.
    "type": "string",
    "location": "string", // Optional. Location if provided.
    "engine": "string"
  },
  "news": [
    {
      "title": "string",
      "link": "string",
      "snippet": "string",
      "date": "string",
      "source": "string",
      "imageUrl": "string",
      "position": "number"
    }
  ]
}
```

* **Content-Type:** `application/json`
* **X-RateLimit-Limit:** The rate limit for the user.
* **X-RateLimit-Remaining:** The remaining number of requests for the user.

### Bad Request (400)

Returned if the request is invalid.

```json theme={null}
{
  "error": "query parameter is required"
}
```

### Unauthorized (401)

Returned if the API key is invalid or missing.

```json theme={null}
{
  "error": "Invalid or missing Authorization header"
}
```

### Internal Server Error (500)

Returned if there's an error during the search process.

```json theme={null}
{
  "error": "Failed to perform news search: [error message]"
}
```

## Example Request

```bash theme={null}
curl -X POST https://app.dumplingai.com/api/v1/search-news \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
  "query": "climate change",
  "country": "US",
  "language": "en"
}'
```

## Notes

* This endpoint uses 30 credits per page of results.
* The `country` parameter should be a two-letter country code (e.g., "US" for United States).
* The `location` parameter can be used to focus the search on a specific area. You can find a list of supported locations at GET: `/api/v1/google-locations`
* The `language` parameter can be used to specify the desired language for the search results.
* Usage is recorded with detailed parameters for each request.
* Events may be logged for analytics purposes if enabled.

## Rate Limiting

Rate limit headers (`X-RateLimit-Limit` and `X-RateLimit-Remaining`) are included in the response to indicate the user's current rate limit status.


## OpenAPI

````yaml POST /api/v1/search-news
openapi: 3.0.3
info:
  title: DumplingAI API
  version: 1.0.0
  description: >
    REST API for DumplingAI's content intelligence and automation platform.

    All endpoints are grouped under `/api/v1`; most are secured via Bearer API
    keys unless an operation explicitly sets `security: []`.
servers:
  - url: https://app.dumplingai.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: YouTube
    description: Access metadata, search results, and transcripts from YouTube.
  - name: TikTok
    description: Retrieve TikTok profile, video, follower, and transcript data.
  - name: LinkedIn
    description: Programmatically fetch LinkedIn company and profile data.
  - name: Search
    description: Search-orientated endpoints spanning web, news, maps, and autocomplete.
  - name: Google
    description: Integrations with Google business listings and location data.
  - name: Scraping
    description: Webpage capture, crawling, and structured content extraction utilities.
  - name: Documents
    description: Document processing, conversion, and metadata utilities.
  - name: AI
    description: DumplingAI agent and knowledge base endpoints.
  - name: Developer Tools
    description: Utilities for executing sandboxed code via API.
paths:
  /api/v1/search-news:
    post:
      tags:
        - Search
      summary: Search news articles
      description: Search global news sources and return structured article metadata.
      operationId: searchNews
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewsSearchRequest'
            examples:
              default:
                value:
                  query: AI regulation
                  dateRange: pastWeek
      responses:
        '200':
          description: News results returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewsSearchResponse'
        '400':
          description: Invalid request payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    NewsSearchRequest:
      type: object
      required:
        - query
      properties:
        query:
          type: string
        country:
          type: string
        location:
          type: string
        language:
          type: string
        dateRange:
          type: string
          enum:
            - pastHour
            - pastDay
            - pastWeek
            - pastMonth
            - pastYear
            - anyTime
        page:
          type: integer
          minimum: 1
        requestSource:
          $ref: '#/components/schemas/RequestSource'
      additionalProperties: false
    NewsSearchResponse:
      type: object
      properties:
        searchParameters:
          type: object
          properties:
            q:
              type: string
            gl:
              type: string
              nullable: true
            type:
              type: string
            location:
              type: string
              nullable: true
            engine:
              type: string
          required:
            - q
            - type
            - engine
          additionalProperties: true
        news:
          type: array
          items:
            $ref: '#/components/schemas/NewsArticle'
      required:
        - searchParameters
        - news
      additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable description of what went wrong.
      required:
        - error
    RequestSource:
      type: string
      description: Optional identifier describing where the API request originated.
      enum:
        - API
        - WEB
        - MAKE_DOT_COM
        - ZAPIER
        - N8N
        - PLAYGROUND
        - DEFAULT_AUTOMATION
        - AGENT_PREVIEW
        - AGENT_LIVE
        - AUTOPILOT
        - STUDIO
    NewsArticle:
      type: object
      properties:
        title:
          type: string
        link:
          type: string
          format: uri
        snippet:
          type: string
        date:
          type: string
        source:
          type: string
        imageUrl:
          type: string
          format: uri
          nullable: true
        position:
          type: integer
      required:
        - title
        - link
        - snippet
        - date
        - source
        - position
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````