Daft.ie API Examples: Visual Basic .NET

Getting started

To use the Daft API in your Visual Basic .NET project, you will need to add a web (or service) reference, using the Project menu in Visual Studio.

Under "Address", enter: https://api.daft.ie/v1/wsdl.xml

Under "Namespace", you may enter anything you wish, but we recommend you use "DaftAPI".

Adding a web reference named "DaftAPI"

Examples for common tasks

Searching for property


' Declare and create a new instance of the API client.

Dim dapi As New DaftAPI.DaftAPIServiceClient
dapi = New DaftAPI.DaftAPIServiceClient

' Declare structures to hold the search query, and the results.
Dim search_query As DaftAPI.search_query
Dim results As DaftAPI.sale_results

' Create a search query, and set the number of bedrooms to 2.
search_query = New DaftAPI.search_query
search_query.bedrooms = 2

' Perform a search for residential "for sale" property.
results = dapi.search_sale("4039260_invalid_example_key_87b7c7c267fa", search_query)

' Display some of the results in the debug/immediate window.
Debug.Print(String.Format("Found {0} results, displaying {1} through {2}.", _
    results.pagination.total_results, _
    results.pagination.first_on_page, _
    results.pagination.last_on_page))

For Each ad In results.ads
    Debug.Print(String.Format("Address: {0} Daft URL: {1}", _
        ad.full_address, ad.daft_url))
Next
?>

Not using VB .NET?

Check our code samples for other languages, or go straight to one of the below: