Documentation Index Fetch the complete documentation index at: https://embedchain-user-dyadav-remove-pipeline.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Quickstart
To use Embedchain as a REST API service, run the following command:
docker run --name embedchain -p 8080:8080 embedchain/rest-api:latest
Navigate to http://localhost:8080/docs to interact with the API. There is a full-fledged Swagger docs playground with all the information about the API endpoints.
โก Steps to get started
โ๏ธ Create an app
cURL
python
javascript
go
curl --request POST "http://localhost:8080/create?app_id=my-app" \
-H "accept: application/json"
import requests
url = "http://localhost:8080/create?app_id=my-app"
payload = {}
response = requests.request( "POST" , url, data = payload)
print (response)
const data = fetch ( "http://localhost:8080/create?app_id=my-app" , {
method: "POST" ,
}). then (( res ) => res . json ());
console . log ( data );
package main
import (
" fmt "
" net/http "
" io/ioutil "
)
func main () {
url := "http://localhost:8080/create?app_id=my-app"
payload := strings . NewReader ( "" )
req , _ := http . NewRequest ( "POST" , url , payload )
req . Header . Add ( "Content-Type" , "application/json" )
res , _ := http . DefaultClient . Do ( req )
defer res . Body . Close ()
body , _ := ioutil . ReadAll ( res . Body )
fmt . Println ( res )
fmt . Println ( string ( body ))
}
๐๏ธ Add data sources
cURL
python
javascript
go
curl --request POST \
--url http://localhost:8080/my-app/add \
-d "source=https://www.forbes.com/profile/elon-musk" \
-d "data_type=web_page"
import requests
url = "http://localhost:8080/my-app/add"
payload = "source=https://www.forbes.com/profile/elon-musk&data_type=web_page"
headers = {}
response = requests.request( "POST" , url, headers = headers, data = payload)
print (response)
const data = fetch ( "http://localhost:8080/my-app/add" , {
method: "POST" ,
body: "source=https://www.forbes.com/profile/elon-musk&data_type=web_page" ,
}). then (( res ) => res . json ());
console . log ( data );
package main
import (
" fmt "
" strings "
" net/http "
" io/ioutil "
)
func main () {
url := "http://localhost:8080/my-app/add"
payload := strings . NewReader ( "source=https://www.forbes.com/profile/elon-musk&data_type=web_page" )
req , _ := http . NewRequest ( "POST" , url , payload )
req . Header . Add ( "Content-Type" , "application/x-www-form-urlencoded" )
res , _ := http . DefaultClient . Do ( req )
defer res . Body . Close ()
body , _ := ioutil . ReadAll ( res . Body )
fmt . Println ( res )
fmt . Println ( string ( body ))
}
๐ฌ Query on your data
cURL
python
javascript
go
curl --request POST \
--url http://localhost:8080/my-app/query \
-d "query=Who is Elon Musk?"
import requests
url = "http://localhost:8080/my-app/query"
payload = "query=Who is Elon Musk?"
headers = {}
response = requests.request( "POST" , url, headers = headers, data = payload)
print (response)
const data = fetch ( "http://localhost:8080/my-app/query" , {
method: "POST" ,
body: "query=Who is Elon Musk?" ,
}). then (( res ) => res . json ());
console . log ( data );
package main
import (
" fmt "
" strings "
" net/http "
" io/ioutil "
)
func main () {
url := "http://localhost:8080/my-app/query"
payload := strings . NewReader ( "query=Who is Elon Musk?" )
req , _ := http . NewRequest ( "POST" , url , payload )
req . Header . Add ( "Content-Type" , "application/x-www-form-urlencoded" )
res , _ := http . DefaultClient . Do ( req )
defer res . Body . Close ()
body , _ := ioutil . ReadAll ( res . Body )
fmt . Println ( res )
fmt . Println ( string ( body ))
}
๐ (Optional) Deploy your app to Embedchain Platform
cURL
python
javascript
go
curl --request POST \
--url http://localhost:8080/my-app/deploy \
-d "api_key=ec-xxxx"
import requests
url = "http://localhost:8080/my-app/deploy"
payload = "api_key=ec-xxxx"
response = requests.request( "POST" , url, data = payload)
print (response)
const data = fetch ( "http://localhost:8080/my-app/deploy" , {
method: "POST" ,
body: "api_key=ec-xxxx" ,
}). then (( res ) => res . json ());
console . log ( data );
package main
import (
" fmt "
" strings "
" net/http "
" io/ioutil "
)
func main () {
url := "http://localhost:8080/my-app/deploy"
payload := strings . NewReader ( "api_key=ec-xxxx" )
req , _ := http . NewRequest ( "POST" , url , payload )
req . Header . Add ( "Content-Type" , "application/x-www-form-urlencoded" )
res , _ := http . DefaultClient . Do ( req )
defer res . Body . Close ()
body , _ := ioutil . ReadAll ( res . Body )
fmt . Println ( res )
fmt . Println ( string ( body ))
}
And youโre ready! ๐
If you run into issues, please feel free to contact us using below links:
Talk to founders Schedule a call
Slack Join our slack community
Discord Join our discord community