firecrawl-dag
A module for working with Firecrawl (firecrawl.dev)
Installation
dagger install github.com/kpenfound/dag/firecrawl@v1.0.1
Entrypoint
Return Type
FirecrawlDag !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
apiKey | Secret ! | - | A reference to a secret value, which can be handled more safely than the value itself. |
Example
dagger -m github.com/kpenfound/dag/firecrawl@dceaf14293512d5876ac5dbb1b2d99de2551969f call \
--api-key env:MYSECRET
func (m *myModule) example(apiKey *Secret) *FirecrawlDag {
return dag.
FirecrawlDag(apiKey)
}
@function
def example(api_key: dagger.Secret) -> dag.FirecrawlDag:
return (
dag.firecrawl_dag(api_key)
)
@func()
example(apiKey: Secret): FirecrawlDag {
return dag
.firecrawlDag(apiKey)
}
Types
FirecrawlDagCrawlPage 🔗
FirecrawlDag 🔗
crawl() 🔗
Crawl a URL and return the content.
Return Type
[FirecrawlDagCrawlPage ! ] !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
url | String ! | - | The URL to crawl. |
Example
dagger -m github.com/kpenfound/dag/firecrawl@dceaf14293512d5876ac5dbb1b2d99de2551969f call \
--api-key env:MYSECRET crawl --url string
func (m *myModule) example(apiKey *Secret, url string) []*FirecrawlDagCrawlPage {
return dag.
FirecrawlDag(apiKey).
Crawl(url)
}
@function
def example(api_key: dagger.Secret, url: str) -> List[dag.FirecrawlDagCrawlPage]:
return (
dag.firecrawl_dag(api_key)
.crawl(url)
)
@func()
example(apiKey: Secret, url: string): FirecrawlDagCrawlPage[] {
return dag
.firecrawlDag(apiKey)
.crawl(url)
}
extract() 🔗
Extract structured data from a website
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
urls | [String ! ] ! | - | The URLs to scrape. |
prompt | String ! | - | The description of the information to extract. |
Example
dagger -m github.com/kpenfound/dag/firecrawl@dceaf14293512d5876ac5dbb1b2d99de2551969f call \
--api-key env:MYSECRET extract --urls string1 --urls string2 --prompt string
func (m *myModule) example(ctx context.Context, apiKey *Secret, urls []string, prompt string) string {
return dag.
FirecrawlDag(apiKey).
Extract(ctx, urls, prompt)
}
@function
async def example(api_key: dagger.Secret, urls: List[str], prompt: str) -> str:
return await (
dag.firecrawl_dag(api_key)
.extract(urls, prompt)
)
@func()
async example(apiKey: Secret, urls: string[], prompt: string): Promise<string> {
return dag
.firecrawlDag(apiKey)
.extract(urls, prompt)
}
map() 🔗
Map a website and get all the urls on the website
Return Type
[String ! ] !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
url | String ! | - | The URL to scrape. |
Example
dagger -m github.com/kpenfound/dag/firecrawl@dceaf14293512d5876ac5dbb1b2d99de2551969f call \
--api-key env:MYSECRET map --url string
func (m *myModule) example(ctx context.Context, apiKey *Secret, url string) []string {
return dag.
FirecrawlDag(apiKey).
Map(ctx, url)
}
@function
async def example(api_key: dagger.Secret, url: str) -> List[str]:
return await (
dag.firecrawl_dag(api_key)
.map(url)
)
@func()
async example(apiKey: Secret, url: string): Promise<string[]> {
return dag
.firecrawlDag(apiKey)
.map(url)
}
scrape() 🔗
Scrape a URL and return the content.
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
url | String ! | - | The URL to scrape. |
Example
dagger -m github.com/kpenfound/dag/firecrawl@dceaf14293512d5876ac5dbb1b2d99de2551969f call \
--api-key env:MYSECRET scrape --url string
func (m *myModule) example(ctx context.Context, apiKey *Secret, url string) string {
return dag.
FirecrawlDag(apiKey).
Scrape(ctx, url)
}
@function
async def example(api_key: dagger.Secret, url: str) -> str:
return await (
dag.firecrawl_dag(api_key)
.scrape(url)
)
@func()
async example(apiKey: Secret, url: string): Promise<string> {
return dag
.firecrawlDag(apiKey)
.scrape(url)
}