Skip to content

Commit 7f2462b

Browse files
committed
Adds google images, maps shopping and search following n8n ux guidelines
1 parent 60342e5 commit 7f2462b

File tree

7 files changed

+3300
-41
lines changed

7 files changed

+3300
-41
lines changed

nodes/SearchApi/SearchApi.node.ts

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { INodeType, INodeTypeDescription } from 'n8n-workflow';
22
import { google } from './engines/google';
3+
import { google_images } from './engines/google_images';
4+
import { google_maps } from './engines/google_maps';
5+
import { google_shopping } from './engines/google_shopping';
36

47
export class SearchApi implements INodeType {
58
description: INodeTypeDescription = {
@@ -8,7 +11,8 @@ export class SearchApi implements INodeType {
811
icon: 'file:searchApi.svg',
912
group: ['output'],
1013
version: 1,
11-
description: 'Call this tool whenever the answer might require fresh, niche, or externally-verifiable information. Make sure to always cite the sources in the final reply. ',
14+
description:
15+
'Access real-time search results from Google, Google Images, Google Maps, Google Shopping and more. Use this when you need current, up-to-date information, product searches, location data, or visual content that may not be available in your training data.',
1216
subtitle: '={{ $parameter["engine"] }}',
1317
defaults: { name: 'SearchApi' },
1418
// @ts-ignore
@@ -28,23 +32,28 @@ export class SearchApi implements INodeType {
2832
},
2933
hints: [
3034
{
31-
message: "Hit SearchAPI's free 100-request quota? Check the Pricing page 📈'",
32-
type: 'info',
33-
whenToDisplay: 'beforeExecution',
34-
location: 'inputPane',
35+
message: "Hit SearchAPI's free 100-request quota? Check the Pricing page 📈'",
36+
type: 'info',
37+
whenToDisplay: 'beforeExecution',
38+
location: 'inputPane',
3539
},
36-
],
40+
],
3741
properties: [
38-
{
42+
// eslint-disable-next-line n8n-nodes-base/node-param-default-missing
43+
{
3944
displayName: 'Resource',
4045
name: 'resource',
4146
type: 'options',
4247
description: 'The search engine to use',
4348
noDataExpression: true,
4449
options: [
45-
google.resource
50+
google.resource,
51+
google_images.resource,
52+
google_maps.resource,
53+
google_shopping.resource,
54+
4655
],
47-
default: '',
56+
default: google.resource.value,
4857
},
4958
{
5059
displayName: 'Operation Name',
@@ -55,20 +64,23 @@ export class SearchApi implements INodeType {
5564
{
5665
name: 'Search',
5766
value: 'search',
58-
action: 'Search the web',
67+
action: 'Search',
5968
description: 'Search using the engine specified in the resource',
6069
routing: {
6170
request: {
6271
qs: {
63-
engine: '={{ $parameter["resource"] }}'
64-
}
65-
}
66-
}
72+
engine: '={{ $parameter["resource"] }}',
73+
},
74+
},
75+
},
6776
},
6877
],
6978
default: 'search',
7079
},
7180
...google.properties,
81+
...google_images.properties,
82+
...google_maps.properties,
83+
...google_shopping.properties,
7284
],
7385
};
7486
}

nodes/SearchApi/engines/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)