Finding records using doctype and field names of models

How to find by some field from tables ? Please point to api’s with some example.


Set Up > Doc Type page has the data you are looking for, is there any specific purpose you need an API?

wanted to search for Lead by either email / phone / or any other field for now. But might need the same for other docTypes. Guessing should be same for all of them.

let me know what is the API for that. The page you mentioned have the table details, not the api I need to call to fetch the lead using mobile/email/ etc…


Here is the link to ERPNext API’s.

The one you are looking for is:
frappe.client.get (doctype, name=None, filters=None)

if I want to search by email, is this the only change ?

frappe.client.get(“Lead”, email="", filters = None)

frappe.client.get("Lead",, filters = {email:""})

Something like this.

what will be format (of parameters) if want to hit the rest end point ( /api/method/frappe.client.get ) ?

You could refer to this link and see if it helps.

What exactly do you mean by this?