Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mindsdb.com/llms.txt

Use this file to discover all available pages before exploring further.

There are two ways to get batch predictions:
  1. Join the model with data tables and use the query endpoint to query for batch predictions.
  2. Query the model using this endpoint and provide data to be used by the model in the request.
import requests
url = 'http://127.0.0.1:47334/api/projects/mindsdb/models/home_rentals_model/predict'

data = [{'number_of_rooms': 2,
  'number_of_bathrooms': 1,
  'sqft': 917,
  'location': 'great',
  'days_on_market': 13,
  'neighborhood': 'berkeley_hills',
  'rental_price': 3901,
  'created_at': '2024-02-24 02:28:21.746167'},
 {'number_of_rooms': 0,
  'number_of_bathrooms': 1,
  'sqft': 194,
  'location': 'great',
  'days_on_market': 10,
  'neighborhood': 'berkeley_hills',
  'rental_price': 2042,
  'created_at': '2024-02-19 06:10:59.693052'},
 {'number_of_rooms': 1,
  'number_of_bathrooms': 1,
  'sqft': 543,
  'location': 'poor',
  'days_on_market': 18,
  'neighborhood': 'westbrae',
  'rental_price': 1871,
  'created_at': '2024-02-12 07:53:45.914146'}]

r = requests.post(url, json={'data': data})
print(r.json())
The REST API endpoints can be used with MindsDB running locally at http://127.0.0.1:47334/api.