RefineAPI Logo RefineAPI

Extract Your First Article in
60 Seconds

Get up and running with RefineAPI quickly using this simple example.

Before you start

You'll need an API key from RapidAPI. Get your free key by subscribing to RefineAPI on RapidAPI.

Demo animation coming soon

An animated demo showing the API workflow will be displayed here

Using cURL (Command Line)

Open your terminal, replace YOUR_RAPIDAPI_KEY with your actual key, and run this command:

curl --request POST \
  --url https://refineapi-structured-article-data.p.rapidapi.com/v1/extract \
  --header 'X-RapidAPI-Host: refineapi-structured-article-data.p.rapidapi.com' \
  --header 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
  --header 'content-type: application/json' \
  --data '{
    "url": "https://www.bbc.com/news/science-environment-56837913",
    "use_llm_metadata": true,
    "use_llm_validation": true,
    "include_markdown": true
  }'

Tip: You can change the example URL to any article you want to extract.

Using Node.js (with Axios)

Create a file (e.g., extract-article.js), install Axios (npm install axios), and run it with node extract-article.js:

import axios from 'axios';

const options = {
  method: 'POST',
  url: 'https://refineapi-structured-article-data.p.rapidapi.com/v1/extract',
  headers: {
    'X-RapidAPI-Host': 'refineapi-structured-article-data.p.rapidapi.com',
    'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY', // Best practice: use environment variables
    'content-type': 'application/json'
  },
  data: {
    url: 'https://www.bbc.com/news/science-environment-56837913',
    use_llm_metadata: true,
    use_llm_validation: true,
    include_markdown: true
  }
};

async function fetchData() {
  try {
    const response = await axios.request(options);
    console.log(JSON.stringify(response.data, null, 2));
  } catch (error) {
    console.error("Error making API call:", 
      error.response ? error.response.data : error.message);
  }
}

fetchData();

Security note: For production use, store your API key in environment variables instead of hardcoding it.

Understanding the Response

Upon successful execution, you'll receive a JSON response like this (abbreviated example):

{
  "metadata": {
    "url": "https://www.bbc.com/news/science-environment-56837913",
    "title": "Climate change: 'Unprecedented' changes in oceans and ice",
    "description": "A major report on oceans and the cryosphere finds the impacts of climate change are 'sweeping and severe.'",
    "authors": ["Matt McGrath"],
    "publication_date": "2019-09-25",
    "publisher": "BBC News",
    "image_url": "https://ichef.bbci.co.uk/news/1024/branded_news/13B31/production/_108951089_gettyimages-915678404.jpg",
    "language": "en"
  },
  "article": {
    "content": [
      "The world's oceans are set to become an increasing source of global warming this century, heating up faster than air temperatures, according to a new report.",
      "Currently, the seas absorb over 90% of the excess heat from atmosphere.",
      // ... more paragraphs ...
    ],
    "entities": [
      "IPCC",
      "Intergovernmental Panel on Climate Change",
      "United Nations",
      "Montreal Protocol",
      "NASA",
      // ... more entities ...
    ],
    "markdown": "# Climate change: 'Unprecedented' changes in oceans and ice\n\nA major report on oceans and the cryosphere finds the impacts of climate change are 'sweeping and severe.'\n\n..."
  }
}

Metadata

  • Article title, description, and URL
  • Author(s) and publication information
  • Publication date and language
  • Primary image URL (when available)

Article Content

  • Clean text paragraphs as an array
  • Named entities (people, organizations, etc.)
  • Formatted Markdown version (when requested)

Test & Integrate Faster

Download our pre-configured API collections for popular clients to start testing RefineAPI in minutes.

Bruno Logo

Bruno Collection

A complete collection for Bruno, the open-source, Git-friendly API client. Includes all endpoints, parameters, and example tests.

Download for Bruno (.zip)
Postman Logo

Postman Collection

Get our official Postman collection to explore RefineAPI. Features pre-built requests for all parameters and plan simulations.

Download for Postman (.zip)

Instructions for setting up environment variables (like your API key) are included within each collection's documentation.

Ready to Start Building?

Sign up for your free RefineAPI key and start extracting structured content in minutes.

Get Your Free API Key Now!

No credit card required for the Developer plan!