BoxLang 🚀 A New JVM Dynamic Language Learn More...

apifycfc

v0.7.0 Modules

apifycfc

A CFML wrapper for the Apify API. Use it to interact with Apify's automated web scraping and automation platform.

This is an early stage API wrapper and does not yet cover the full Apify API. Feel free to use the issue tracker to report bugs or suggest improvements!

Acknowledgements

This project borrows heavily from the API frameworks built by jcberquist. Thanks to John for all the inspiration!

Table of Contents

Quick Start

The following is a quick example of listing the actors in your account.

apify = new path.to.apifycfc.apify( apify_token = 'xxx' );

actors = apify.listActors();

writeDump( var='#actors.data#' );

Authentication

To get started with the Apify API, you'll need an API token .

Once you have this, you can provide them to this wrapper manually when creating the component, as in the Quick Start example above, or via an environment variable named APIFY_TOKEN, which will get picked up automatically. This latter approach is generally preferable, as it keeps hardcoded credentials out of your codebase.

Setup

There are several options you can configure when initializing the CFC.

NameTypeDefaultDescription
apify_tokenstring If you do not provide this via the init method, it must be provided as an environment variable, as explained in the authentication section.
baseUrlstringhttps://api.apify.com/v2The base endpoint for the API. You shouldn't need to change this, unless you're testing something.
includeRawbooleanfalseWhen set to true, details of each request (HTTP Method, path, query params, payload) will be included in the response struct.
httpTimeoutnumeric360Timeout for http requests, in seconds.
maxRetriesnumeric8Like Apify's official JavaScript and Python clients, this CFC provides automatic retries, with exponential backoff. This setting configures the number of retry attempts that should be made before throwing an error.
doNotRetryTimeoutsbooleanfalseWhen set to true, requests that time out will not be automatically retried.
debugbooleanfalseWhen set to true, debugging information will be logged to the console.

Reference Manual

A full reference manual for all public methods in apify.cfc can be found in the docs directory, here.


$ box install apifycfc

No collaborators yet.
     
  • {{ getFullDate("2021-12-23T22:43:53Z") }}
  • {{ getFullDate("2022-01-05T20:17:40Z") }}
  • 1,086
  • 1