Using Yes Postcode Search API in C# is very easy. You can find a sample client application below. All you need to do is send a GET request to our service along with your API key.

If you have any questions regarding that code or have any suggestions for improvement, please let us know!

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.IO;
namespace YesPostcodeSearchApiClient
{
    class Program
    {
        static void Main(string[] args)
        {
            string version = "1";
            string apiKey = "1234567890123456789012345678901234567890";
            string postcode = "YP3 1OK";
            string escapedPostcode = postcode.Replace(" ", "%20");
            string format = "json";
            string api_url = "https://api.yespostcodesearch.co.uk/api/" + version + "/postcode/" 
                           + escapedPostcode + "." + format + "?key=" + apiKey;
            string res = "";
            HttpWebRequest getRequest = (HttpWebRequest)WebRequest.Create(api_url);
            getRequest.Method = "GET";
            HttpWebResponse form = (HttpWebResponse)getRequest.GetResponse();
            using (StreamReader response = new StreamReader(form.GetResponseStream(), Encoding.UTF8))
            {
                res = response.ReadToEnd();
            }
            Console.WriteLine(res);
        }
    }
}