Posts

Automatically Accepting Chase Card Offers

This isn’t something I’ll write normally about but I thought it was a fun little exercise. If you own a chase credit card, you’re most likely familiar with the concept of an offer. Each credit card you own has the option to be enrolled in a set of revolving offers that are time sensitive. For example, this month, I have a 15% off offer for Starbucks. If I use my Chase card at Starbucks, I’ll get 15% of the transaction added to my credit. Now, that’s only if I’m aware ahead of time and know I’ll be going to Starbucks and if I know I have an offer for Starbucks. Accepting offers is a pain and the normal workflow is to go to the Chase website, go to your credit cards, look up the current offers, and then accept them. That’s a lot of steps. For about 50 offers, it’ll take you several minutes to even click and have the offers added to your card. Now, I did this several times and at some point I got tired of it. So very quickly, I decided to at least automate the process of “clicking” on ...

Writing an API Client

Why write an API client Most automation flows require interacting with HTTP APIs. Communicating with these APIs requires an HTTP client. A ubiquitous example of a client is a web browser. However, for most automation tasks, a web browser is too heavy. We turn to relatively lightweight clients like cURL or in Windows land Invoke-WebRequest. For automation purposes specifically, we often use the client provided by the language or a popular third-party client. In Python most developers default to using the Requests library. The native urllib.request module is perfectly fine albeit less ergonomic. I’ll be covering how to make a basic HTTP request in the languages that I frequently use later but for now we will be using Python. Generally, it is advisable to seek out an official API client provided by the developers of that API. For example, Stripe and Twilio both have official SDKs for various languages. These should be used instead of rolling your own client. It can be desirable to rol...