Public Actors Lister avatar

Public Actors Lister

Try for free

No credit card required

View all Actors
Public Actors Lister

Public Actors Lister

jancurn/public-actors-fetcher
Try for free

No credit card required

Downloads a list of all Actors published in Apify Store, with all properties such as URL, title, description, etc. This is useful to create a knowledge file for a GPT, so that it knows which Actors can it use.

.actor/Dockerfile

1# Specify the base Docker image. You can read more about
2# the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images
3# You can also use any other image from Docker Hub.
4FROM apify/actor-node:18
5
6# Copy just package.json and package-lock.json
7# to speed up the build using Docker layer cache.
8COPY package*.json ./
9
10# Install NPM packages, skip optional and development dependencies to
11# keep the image small. Avoid logging too much and print the dependency
12# tree for debugging
13RUN npm --quiet set progress=false \
14    && npm install --omit=dev --omit=optional \
15    && echo "Installed NPM packages:" \
16    && (npm list --omit=dev --all || true) \
17    && echo "Node.js version:" \
18    && node --version \
19    && echo "NPM version:" \
20    && npm --version \
21    && rm -r ~/.npm
22
23# Next, copy the remaining files and directories with the source code.
24# Since we do this after NPM install, quick build will be really fast
25# for most source file changes.
26COPY . ./
27
28
29# Run the image.
30CMD npm start --silent

.actor/actor.json

1{
2    "actorSpecification": 1,
3    "name": "my-actor-23",
4    "title": "Scrape single page in JavaScript",
5    "description": "Scrape data from single page with provided URL.",
6    "version": "0.0",
7    "meta": {
8        "templateId": "js-start"
9    },
10    "input": "./input_schema.json",
11    "storages": {
12        "dataset": {
13            "actorSpecification": 1,
14            "views": {
15                "overview": {
16                    "title": "Overview",
17                    "transformation": {
18                        "fields": [
19                            "pictureUrl",
20                            "url",
21                            "title",
22                            "description",
23                            "categories",                            
24                            "authorFullName",
25                            "authorPictureUrl"
26                        ]
27                    },
28                    "display": {
29                        "component": "table",
30                        "properties": {
31                            "pictureUrl": {
32                                "label": "Image",
33                                "format": "image"
34                            },
35                            "url": {
36                                "label": "URL",
37                                "format": "link"
38                            },
39                            "title": {
40                                "label": "Title",
41                                "format": "text"
42                            },
43                            "description": {
44                                "label": "Description",
45                                "format": "text"
46                            },
47                            "authorFullName": {
48                                "label": "Author",
49                                "format": "text"
50                            },
51                            "authorPictureUrl": {
52                                "label": "Author picture",
53                                "format": "image"
54                            }
55                        }
56                    }
57                }
58            }
59        }
60    },
61    "dockerfile": "./Dockerfile"
62}

.actor/input_schema.json

1{
2    "title": "This Actor has no input",
3    "type": "object",
4    "schemaVersion": 1,
5    "properties": {
6        "search": {
7            "title": "Search term",
8            "type": "string",
9            "description": "Filter Actors by string in title, name, description, username and readme.",
10            "editor": "textfield"
11        }
12    },
13    "required": []
14}

src/main.js

1import { Actor } from 'apify';
2import { ApifyClient } from 'apify-client';
3
4await Actor.init();
5
6const apifyClient = new ApifyClient();
7
8const { search } = await Actor.getInput()
9
10// Fetch all Actors
11let actors = [];
12const fetchNextChunk = async (offset = 0) => {
13    const limit = 1000;
14    const value = await apifyClient.store({ search }).list({ offset, limit });
15
16    if (value.count === 0) {
17        return;
18    }
19
20    actors.push(...value.items);
21
22    if (value.total > offset + value.count) {
23        return fetchNextChunk(offset + value.count);
24    }
25};
26await fetchNextChunk();
27
28// Tranform the records
29const results = [];
30for (const actor of actors) {
31    results.push({
32        id: actor.id,
33        url: `https://apify.com/${actor.username}/${actor.name}`,
34        title: actor.title,
35        titleWithUrl: `[(${actor.title})](https://apify.com/${actor.username}/${actor.name})`,        
36        pictureUrl: actor.pictureUrl,
37        description: actor.description,
38        categories: actor.categories,
39        authorPictureUrl: actor.userPictureUrl,
40        authorFullName: actor.userFullName,
41        usersTotal: actor.stats.totalUsers, 
42        usersMonthly: actor.stats.totalUsers30Days, 
43    });
44}
45
46await Actor.pushData(results);
47
48await Actor.exit();
49ons

.dockerignore

1# configurations
2.idea
3
4# crawlee and apify storage folders
5apify_storage
6crawlee_storage
7storage
8
9# installed files
10node_modules
11
12# git folder
13.git

.gitignore

1# This file tells Git which files shouldn't be added to source control
2.DS_Store
3.idea
4dist
5node_modules
6apify_storage
7storage/*
8!storage/key_value_stores
9storage/key_value_stores/*
10!storage/key_value_stores/default
11storage/key_value_stores/default/*
12!storage/key_value_stores/default/INPUT.json

package.json

1{
2    "name": "js-scrape-single-page",
3    "version": "0.0.1",
4    "type": "module",
5    "description": "This is an example of an Apify actor.",
6    "engines": {
7        "node": ">=18.0.0"
8    },
9    "dependencies": {
10        "apify": "^3.1.10"
11    },
12    "scripts": {
13        "start": "node ./src/main.js",
14        "test": "echo \"Error: oops, the actor has no tests yet, sad!\" && exit 1"
15    },
16    "author": "It's not you it's me",
17    "license": "ISC"
18}
Developer
Maintained by Community

Actor Metrics

  • 5 monthly users

  • 6 stars

  • >99% runs succeeded

  • Created in Jan 2024

  • Modified 7 months ago