📝

news

News article or news story with headline, content, source attribution, geographic and language information. Used for news websites, RSS feeds, and news aggregation platforms.

🎯 Request Builder

https://api.mockly.codes/newses?page=1&limit=10&count=10
📡

Configure your request and click Send Request to see the response here.

Endpoints

GET/newses

Get a collection of news

Alternative: /content/newses
GET/newses/:id

Get a single news by ID

Alternative: /content/newses/:id
GET/newses/meta

Get resource metadata and schema

Alternative: /content/newses/meta
🔍

How to Use Search

The search feature allows you to filter results by searching for text across all or specific fields. Choose between ?q= or ?search= parameter names.

1. Basic Search

Search across all text fields:

Basic Search
GET https://api.mockly.codes/newses?q=laptop

2. Search Specific Fields

Field-Specific Search
GET https://api.mockly.codes/newses?q=laptop&search_fields=name,description

💡 Pro Tips

  • Search is case-insensitive and performs partial matching
  • Without search_fields, all text fields are searched
  • Combine with pagination to handle large result sets efficiently

Code Examples

JavaScript

Fetch Collection
// Get 10 news
fetch('https://api.mockly.codes/newses?count=10')
  .then(res => res.json())
  .then(data => console.log(data));

Python

Fetch with Requests
import requests

response = requests.get(
    'https://api.mockly.codes/newses?count=10'
)
data = response.json()

cURL

Command Line
curl "https://api.mockly.codes/newses?count=10"

Bypass Cache

Get Fresh Data
fetch('https://api.mockly.codes/newses?nocache=true')

Schema Properties

idinteger

Unique identifier for the news article

Gen:random_int
headlinestring

Main headline or title of the news story

Gen:sentence
summarystring

Brief summary or lead paragraph of the news article

Gen:paragraph
contentstring

Full news article content and body text

Gen:paragraph
authorstring

Full name of the journalist or reporter who wrote the article

Gen:name
sourcestring

News organization or publication that published the article (e.g., BBC, CNN, Reuters)

Gen:company
categorystring

News category (e.g., Politics, Business, Technology, Sports, World)

Gen:news_category
countrystring

Country where the news story originates or is most relevant

Gen:country
languagestring

Language code of the article content (e.g., en, es, fr)

Gen:language
tagsarray

Array of topic tags for categorization and search

Gen:tags
imagestring

URL to the featured image or photo accompanying the news article

Gen:image_urluri
urlstring

Original URL where the news article was published

Gen:urluri
published_atstring

Timestamp when the news article was published

Gen:past_datedate-time

Query Parameters

countinteger

Number of items to return (default: 10, max: 100)

seedinteger

Seed for reproducible data generation

nocacheboolean

Bypass cache and generate fresh data on every request