# websearch: Web Search – Tavily or Google Results

> websearch (Web Search – Tavily or Google Results) is a 1001fx API function in the group Data & JSON: POST https://api.1001fx.com/data/websearch, 12 credits per item. It works as a ready-made module in Make or as a plain HTTP call.

Searches the web and returns results in one format, with Tavily (a list of results with snippets) or Google (an AI answer with its source links). The query goes to the chosen provider. Tavily costs 12 credits per search, 24 with searchDepth advanced. Google costs 24 credits per query the model runs, a call can run several. Failed searches are not charged.

- This service is provided by an external service provider: Tavily, Google. The data of the call is sent to the provider. [More about service providers](https://1001fx.com/functions#serviceproviders)

- Group: Data & JSON
- Endpoint: `POST https://api.1001fx.com/data/websearch`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: application/json
- Credits: 12 credits per item
- Ready-made in: Make
- Service provider: Tavily, Google
- Docs: https://1001fx.com/functions/websearch

## Parameters

- `query` (string, required) – Search query: What to search for, at most 400 characters.
- `provider` (enum, optional, one of `tavily`, `google`, default `tavily`) – Provider: tavily (default) returns a list of results with snippets. google returns an AI answer with its source links and is charged per query the model runs. Show a google answer only together with its searchSuggestions, to the person who asked.
- `maxResults` (number, optional, default `5`, min 1, max 20) – Max results: Number of results, 1 to 20. Tavily only.
- `searchDepth` (enum, optional, one of `basic`, `advanced`, default `basic`) – Search depth: basic (default) or advanced (more relevant snippets, twice the credits). Tavily only.
- `topic` (enum, optional, one of `general`, `news`, `finance`, default `general`) – Topic: general (default), news or finance. Tavily only.
- `timeRange` (enum, optional, one of `day`, `week`, `month`, `year`) – Time range: Only results from the last day, week, month or year. Tavily only.
- `includeAnswer` (boolean, optional, default `false`) – Include answer: Adds a short AI answer to the results. Tavily only, google always answers.
- `includeDomains` (array<string>, optional) – Include domains: Search only these domains, at most 300. Tavily only.
- `excludeDomains` (array<string>, optional) – Exclude domains: Leave out these domains, at most 150. Tavily only.

## Example: Search with Tavily

```bash
curl -X POST 'https://api.1001fx.com/data/websearch' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"query":"What does the EU AI Act require from small companies?"}'
```
