Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions apps/docs/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6053,6 +6053,24 @@ export function ZepIcon(props: SVGProps<SVGSVGElement>) {
)
}

interface WebzIconProps extends SVGProps<SVGSVGElement> {}

/** Webz.io's mark, extracted from https://webz.io/wp-content/themes/webz.io/assets/images/logo-blue.svg. */
export function WebzIcon(props: WebzIconProps) {
return (
<svg {...props} viewBox='-2 0 36 36' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path
d='M27.158 7.78V19.751C27.158 23.198 25.378 24.596 22.897 24.596C20.462 24.596 18.636 23.151 18.636 19.751V7.78H13.532V19.751C13.532 23.151 11.753 24.596 9.318 24.596C6.93 24.596 5.151 23.291 5.057 20.077C4.355 20.59 3.465 20.916 2.528 20.916C1.592 20.916 0.702 20.59 0 20.077C0.094 26.459 3.886 29.3 8.803 29.3C11.987 29.3 14.562 27.996 16.061 25.62H16.154C17.699 27.996 20.228 29.3 23.412 29.3C28.375 29.3 32.215 26.319 32.215 19.751V7.78H27.158ZM5.057 13.23V7.78H0V13.23C0.702 12.718 1.592 12.392 2.528 12.392C3.512 12.392 4.355 12.718 5.057 13.23Z'
fill='currentColor'
/>
<path
d='M4.916 16.63C4.916 17.935 3.84 19.006 2.528 19.006C1.217 19.006 0.14 17.935 0.14 16.63C0.14 15.326 1.217 14.255 2.528 14.255C3.84 14.255 4.916 15.326 4.916 16.63Z'
fill='#FC9F00'
/>
</svg>
)
}

export function WebflowIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
Expand Down
2 changes: 2 additions & 0 deletions apps/docs/components/ui/icon-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ import {
WealthboxIcon,
WebflowIcon,
WebhookIcon,
WebzIcon,
WhatsAppIcon,
WikipediaIcon,
WindchillIcon,
Expand Down Expand Up @@ -678,6 +679,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
wealthbox: WealthboxIcon,
webflow: WebflowIcon,
webhook_request: WebhookIcon,
webz: WebzIcon,
whatsapp: WhatsAppIcon,
wikipedia: WikipediaIcon,
windchill: WindchillIcon,
Expand Down
1 change: 1 addition & 0 deletions apps/docs/content/docs/integrations/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@
"wealthbox-service-account",
"webflow",
"webflow-service-account",
"webz",
"whatsapp",
"wikipedia",
"windchill",
Expand Down
99 changes: 99 additions & 0 deletions apps/docs/content/docs/integrations/webz.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
title: Webz.io
description: Search news with natural language
---

import { BlockInfoCard } from "@/components/ui/block-info-card"

<BlockInfoCard
type="webz"
color="#2E3E56"
/>

{/* MANUAL-CONTENT-START:intro */}
[Webz.io](https://webz.io/products/news-search-api/) searches recent news by meaning and returns articles with matching passages and source metadata.

With the Webz.io block, you can:

- **Research news**: Find coverage of companies, industries, and events using a natural-language query.
- **Focus the results**: Filter by publication dates, language, source country, source domain, sentiment, or category.
- **Build sourced briefings**: Pass article links, publication dates, matching passages, and relevance scores to other blocks.

Create a [Webz.io API key](https://app.webz.io/) with `api_news` access and a positive credit balance. Store it in a Sim environment variable such as `WEBZ_API_KEY`, then reference it as `{{WEBZ_API_KEY}}` in the block's API Key field. Successful searches consume Webz credits; the output includes `credits_used` when the API reports it.

News Search covers the recent 30-day news window. Queries support up to 750 characters and 100 words. In advanced mode, set Maximum Results from 1 to 100; leaving it empty uses Webz's default of 10. The default minimum relevance score is 4; set it to 0 to remove that threshold.

Use full language names such as `english` and source-country codes such as `US`. Source Countries filters where a publication is based, not the location discussed in its articles. Categories accepts a JSON array, for example `["Economy, Business and Finance", "Science and Technology"]`, so commas within category names are preserved. See the [Webz filter reference](https://docs.webz.io/docs/webz/news-search-api-filters) for supported values.

In Sim, the Webz.io block supplies news evidence for research agents, coverage monitoring, and industry briefings.
{/* MANUAL-CONTENT-END */}


## Usage Instructions

Search recent news with the Webz.io News Search API. Retrieve relevant articles, matching passages, relevance scores, and source metadata, with filters for publication dates, language, source country, domains, sentiment, and category.



## Actions

### Webz.io News Search

Search recent news using natural language. Returns relevant articles, matching passages, relevance scores, and source metadata.

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `apiKey` | string | Yes | Webz.io API key with News API access and available credits |
| `query` | string | Yes | Natural-language news query, up to 750 characters and 100 words |
| `k` | number | No | Maximum number of articles to return, from 1 to 100 \(default: 10\) |
| `publishedAfter` | string | No | Earliest publication date in YYYY-MM-DD format |
| `publishedBefore` | string | No | Latest publication date in YYYY-MM-DD format |
| `language` | array | No | Article languages, for example \["english", "spanish"\] |
| `country` | array | No | Source countries as ISO-2 codes, for example \["US", "GB"\] |
| `source` | array | No | Limit results to source domains, for example \["reuters.com", "bbc.com"\] |
| `sentiment` | array | No | Article sentiments: positive, negative, or neutral |
| `category` | array | No | Article categories, for example \["Politics", "Economy, Business and Finance"\] |
| `scoreGte` | number | No | Minimum relevance score from 0 to 10 \(default: 4\). Set 0 to disable the threshold. |
| `scoreLte` | number | No | Maximum relevance score from 0 to 10. Omit for no upper bound. |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `query` | string | The search query |
| `total_results` | number | Number of results returned |
| `requests_left` | number | Remaining credit balance |
| `credits_used` | number | Credits consumed by this request |
| `results` | array | News articles with matching passages and relevance scores |
| ↳ `score` | number | Relevance score from 0 to 10 |
| ↳ `article` | object | Article identity and content summary |
| ↳ `article_id` | string | Unique article ID |
| ↳ `url` | string | Article URL |
| ↳ `title` | string | Article title |
| ↳ `published_at` | string | Publication timestamp |
| ↳ `summary` | string | Article summary |
| ↳ `main_image` | string | Main image URL |
| ↳ `chunk` | object | The article passage that matches the query |
| ↳ `chunk_id` | string | Unique chunk ID |
| ↳ `chunk_index` | number | Chunk position in the article |
| ↳ `text` | string | Matching passage text |
| ↳ `metadata` | object | Article enrichment and source information |
| ↳ `language` | string | Article language |
| ↳ `country` | string | Source country code |
| ↳ `category` | array | Article categories |
| ↳ `sentiment` | string | Article sentiment |
| ↳ `domain` | string | Source domain |
| ↳ `site_type` | string | Source site type |
| ↳ `topic` | array | Topic tags |
| ↳ `person` | array | Mentioned people |
| ↳ `organization` | array | Mentioned organizations |
| ↳ `location` | array | Mentioned locations |
| ↳ `ticker` | array | Stock ticker symbols |
| ↳ `source_type` | string | Source classification |
| ↳ `political_bias` | string | Source political bias |
| ↳ `trust_category` | string | Source trust classification |
| ↳ `domain_rank` | number | Source domain rank |


42 changes: 42 additions & 0 deletions apps/sim/blocks/blocks/webz.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { describe, expect, it } from 'vitest'
import { WebzBlock } from '@/blocks/blocks/webz'

function transformParams(params: Record<string, unknown>) {
const transform = WebzBlock.tools.config?.params
if (!transform) throw new Error('Webz block params transform is missing')
return transform(params)
}

describe('Webz filter validation keeps resolved input out of errors', () => {
it.each(['category', 'language', 'country', 'source', 'sentiment'])(
'rejects malformed %s JSON without exposing its contents',
(field) => {
expect(() => transformParams({ [field]: '[synthetic-secret-value' })).toThrowError(
new Error(`${field} must be an array of strings`)
)
}
)

it.each([
{ field: 'category', value: '{"private":"synthetic-secret-value"}', shape: 'object' },
{ field: 'category', value: '"synthetic-secret-value"', shape: 'string' },
{ field: 'category', value: 'null', shape: 'null' },
{
field: 'category',
value: '["Economy, Business and Finance", {"private":"synthetic-secret-value"}]',
shape: 'mixed array',
},
{
field: 'language',
value: '["english", {"private":"synthetic-secret-value"}]',
shape: 'object item',
},
{ field: 'country', value: '["US", 123]', shape: 'number item' },
{ field: 'source', value: '[["synthetic-secret-value"]]', shape: 'nested array' },
{ field: 'sentiment', value: '["negative", null]', shape: 'null item' },
])('rejects $field JSON containing a $shape with a safe error', ({ field, value }) => {
expect(() => transformParams({ [field]: value })).toThrowError(
new Error(`${field} must be an array of strings`)
)
})
})
Loading