Fetch URL Content

Extract clean full text or highlights from known URLs

Live preview

Checking API key

How it works

One request to Exa's /contents endpoint with urls and highlights returns clean extracted content for a link you already have, from a search result, a citation, or user input.

highlights is the default for agent tools. Short excerpts keep downstream prompts small, and highlights.query steers them toward what the next model call needs. Switch to text when the model needs the full page body.

Source code

npm install exa-js
import Exa from "exa-js";

const exa = new Exa("YOUR_API_KEY");

const result = await exa.getContents(
  ["https://react.dev/blog/2024/12/05/react-19"],
  {
    highlights: {
      query: "migration details and breaking changes",
    },
  },
);

const page = result.results[0];

console.log({
  title: page.title,
  url: page.url,
  highlights: page.highlights,
});
Ask ExaBot