The function getShortCode extracts the unique identifier from an Instagram URL.

  • Parameters

    • url: string

      The getShortCode function takes a URL as input and extracts the shortcode from an Instagram URL. The shortcode is typically found in Instagram URLs for posts, reels, etc.

    Returns string

    shortcode - The function getShortCode returns the shortcode extracted from the Instagram URL provided as input. If a valid shortcode is found in the URL, it is returned. Otherwise, it returns null.