VanityURL checker in Python
This is a good start for a script. The next step should be separating in-/output from the functions doing the actual work.

In addition, whenever you make multiple requests to the same server, you should use a requests.Session, which will re-use the connection. You can also pass a dictionary params which will be the URL-encoded parameters for the request. The Session can take a default value for that.

You should always use with when opening a file or resource. This way it is ensured that it is closed properly, even if an exception occurs during the intervening code.

You can write multiple rows at once using writelines. You can even pass an iterable to this function and it will iterate for you.

I would write your script something like this:

import requests

URL = "https://api.steampowered.com/ISteamUser/ResolveVanityURL/v0001/"
PARAMS = {"key": "removed"}

def url_available(session, url):
    response = session.get(URL, params={"vanityurl": url}).json()
    return response['response']['success'] == 42

def main():
    session = requests.Session()
    session.params = PARAMS
    with open('ok.txt') as in_file, open('www.txt', 'w') as out_file:
        out_file.writelines(url for url in in_file
                            if url_available(session, url.strip()))

if __name__ == "__main__":
    with Timer("main"):
        main()


To this you should add a docstring to each function describing what it does, but that is left as an exercise :).

Here Timer is a simple class that starts a timer when the context is entered and reports the result when the with block is finished:

from time import perf_counter

class Timer:
    def __init__(self, name):
        self.name = name

    def __enter__(self):
        self.start = perf_counter

    def __exit__(self, *args):
        diff = round(perf_counter() - self.start, 2)
        print(f'{self.name} finished in {diff} second(s)')