How can all consulted URLs be retrieved from OpenAI web search?

The Citead team, updated

In short. Request web_search_call.action.sources to retrieve the complete consulted URL list from an OpenAI Responses API web search.

Definition: OpenAI's sources field returns the complete list of URLs that the web search tool consulted while forming a response. It is requested through web_search_call.action.sources, alongside the inline URL annotations that identify sources used in the answer text.

Key facts

  • OpenAI documents sources as the complete list of consulted URLs, while inline citations show the most relevant references in the answer (Web search).
  • The Responses API request asks for this data with include: ["web_search_call.action.sources"] (Create a model response).
  • The response can contain a web_search_call item with a search, open_page, or find_in_page action (Web search).
  • In the API reference, a search action has an optional sources array, whose entries contain a source type and a source url (Create a model response).
  • OpenAI says that the sources field is available with both web_search and the legacy web_search_preview tool (Web search).

What should an API client request?

The current web search guide recommends the Responses API with the web_search tool for a new integration. The request-level include parameter asks the API to return additional output data. Add the exact includable value below to the response request:

include: ["web_search_call.action.sources"],

The API reference lists web_search_call.action.sources as the value that includes the sources of the web search tool call. The same reference describes include as optional, so the complete URL list is an explicitly requested part of the response rather than the inline citation annotation itself.

Where are the URLs in the response?

Read the response output items and select each item whose type is web_search_call. Its action describes how the model used the web. For a search action, the reference exposes an optional sources array. Each source has type: "url" and a string url.

One response can expose more than one search call because the guide lists a search action as one of several web search actions and describes reasoning models as able to search, open a page, and find text within a page. A client that records the full search history therefore examines every search action returned in the output and records the URLs in its sources arrays.

The inline path remains separate. The guide places cited URLs in message.content[0].annotations and describes each url_citation as carrying a URL, title, and location in the response. The sources list is the broader audit field because OpenAI says it can contain more sources than the citations shown in the answer.

What can the list contain?

OpenAI documents real-time third-party feeds in the sources field and says they are labeled oai-sports, oai-weather, or oai-finance. The guide also states that the sources field is available for web_search_preview, which is retained for legacy integrations, while the current integration uses web_search in the Responses API.

The API reference models sources as optional on a search action. A missing array in a particular search action is therefore a response shape that a client must handle. The documented field supplies source URLs returned with the search action; it does not turn the inline citation annotations into a complete retrieval log.

FAQ

Does the sources field contain more URLs than the answer displays?

Yes. OpenAI describes inline citations as the most relevant references and says the sources list is often larger than the citations. Use the sources array when you need the complete list documented for the response.

How do you read the URL value?

Read each source object in each returned search action, then read its url string. The API reference identifies the source type as url.

Is web_search_call.action.sources returned by default?

The documentation presents it as an include value for additional output data. Add it to the Responses API request when the application needs the consulted URL list.

Sources

  1. OpenAI, "Web search", undated
  2. OpenAI, "Create a model response", undated

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark