NewTimeSpace API

For more information or technical support, please contact:

contact@newtimespace.com

NewTimeSpace API Retrieve Single or Multiple News Articles

Method: GET

Endpoint: /api/v1/news/:id

Description: Retrieves detailed information for one or more specified news articles. Multiple IDs are supported and should be separated by commas.

News Item Fields

  • article_id: string, article ID.
  • language: string, language code.
  • title: string, title.
  • description: string, description.
  • content: string, full content.
  • tags: string, tags (comma-separated).
  • keywords: array, keywords.
  • authors: array, authors.
  • category: string, category.
  • dataType: string, constant value "news".
  • url: string, article URL.
  • pubDate: string, publication datetime (Y-m-d H:i:s).
  • pubDateTZ: string, timezone (UTC).
  • date: string, date (Y-m-d).
  • time: string, time (H:i:s).
  • updated_at: string, last updated time.
  • word_count: integer, word count.
  • reading_time: integer, estimated reading time (minutes).
  • is_breaking_news: boolean, whether it is breaking news.
  • sentiment: string, sentiment (e.g. neutral).
  • related_articles: array, related articles.
  • geo_location: string, geographic location.
  • source: object, source information (id, name, url, country, icon).
  • image: object, image information (url, alt, caption, source, credit).
  • video: object, video information (url, thumbnail, duration, source, credit).

Single Article JSON Response Example
Multiple Articles JSON Response Example
Error Response (JSON Example)
                         {
 "status": "success",
 "data": {
   "article_id": "123",
   "language": "en",
   "title": "News Title",
   "description": "News description",
   "content": "News content",
   "tags": "Tag1,Tag2",
   "keywords": ["Keyword1", "Keyword2"],
   "authors": ["Author1", "Author2"],
   "category": "Category name",
   "dataType": "news",
   "url": "https://www.newtimespace.com/zh-cn/article/123",
   "pubDate": "2026-01-13 12:00:00",
   "pubDateTZ": "UTC",
   "date": "2026-01-13",
   "time": "12:00:00",
   "updated_at": "2026-01-13 13:00:00",
   "word_count": 500,
   "reading_time": 3,
   "is_breaking_news": false,
   "sentiment": "neutral",
   "related_articles": [],
   "geo_location": "",
   "source": {
     "id": "",
     "name": "NewTimeSpace",
     "url": "",
     "country": "",
   "icon": ""
   },
   "image": {
     "url": "",
     "alt": "",
     "caption": "",
     "source": "",
     "credit": ""
   },
   "video": {
     "url": null,
     "thumbnail": "",
     "duration": "",
     "source": "",
     "credit": ""
   }
  }
 },
 "pagination": {
   "page": 1,
   "limit": 10,
   "total": 100,
   "pages": 10
  }
 }
                        
                      

Parameter arrow

parameter type required description default
articleIds string Yes Article IDs (comma-separated, e.g. "123,456") ''
language string No Language (zh-cn, zh-hk, en) zh-cn
format string No Response format (json or xml). json

Status Codes arrow

  • 200: Success.
  • 400: Invalid parameters.。
  • 404: News not found.
  • 500: Internal server error.

Error Handling arrow

  • The API uses standard HTTP status codes.
  • Error responses include "status": "error" and a "message" field (JSON).
  • XML error format:Error message

Additional Information arrow

  • Logging: Errors are recorded in system logs (Log::write).
  • Caching: Category information uses static caching.
  • Language Conversion: For zh-hk, Simplified/Traditional Chinese conversion is applied (requires a Chinese library).
  • Security: Parameter filtering (intval, trim, addslashes).
  • Dependencies: ThinkPHP framework, database tables (e.g. ts_information_news).